以下是可重现的例子。每当我包含一个 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()
```
kable
调用更改为kable(format = "html", table.attr = 'class=\"table table=striped table-hover \"')
来“修复”了这个问题。 - kevinykuo