在RMarkdown文档中添加ggvis图使得knitr :: kable输出渲染不正确

时间:2014-07-24 15:01:24

标签: r knitr rstudio r-markdown ggvis

下面的可重复示例。每当我加入ggvis数字时,我就会在桌面上丢失格式。

---
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()
```

1 个答案:

答案 0 :(得分:2)

这可能与ggvis开发版本中已修复的错误有关。如果您使用devtools::install_github('rstudio/ggvis')安装最新版本,它应该有效。