Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding ggvis plot in RMarkdown document makes knitr::kable output render incorrectly

Reproducible example below. I lose formatting on the table whenever I include a ggvis figure.

---
title: "test"
output: html_document
---

```{r setup, include=FALSE}
library(dplyr)
library(ggvis)
library(knitr)
```

The following table looks fine...

```{r echo=FALSE, results='asis'}
cars %>% kable(format = 'markdown')
```

As long as I don't include this plot below

```{r, echo=FALSE}
pressure %>%
  ggvis(x = ~temperature, y = ~pressure) %>%
  layer_bars()
```
like image 602
kevinykuo Avatar asked Oct 31 '22 19:10

kevinykuo


1 Answers

This is probably related to a bug that has been fixed in the development version of ggvis. If you install the latest with devtools::install_github('rstudio/ggvis'), it should work.

like image 96
wch Avatar answered Nov 09 '22 04:11

wch