【发布时间】:2019-01-22 16:49:07
【问题描述】:
如何将 kable 表与 rmarkdown html_document 中的 ggplot2 图对齐?
Foo.Rmd
---
title: "Foo"
output: html_document
---
```{r setup, include=FALSE}
library(ggplot2)
library(knitr)
library(kableExtra)
```
# Table next to plot
```{r echo = FALSE}
kable(head(iris)) %>%
kable_styling(bootstrap_options = "striped", full_width = F)
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point()
```
我尝试按照解决方案 here 进行操作,但无济于事。
【问题讨论】:
-
嗯,这绝对是一个类似的问题,但我认为这个问题截然不同,因为它要求在 pdf_document 中对齐表格和绘图,而不是 html_document 就像我的情况一样。 (更不用说,唯一的答案不适合我的需要,因为它不使用 kable。)
标签: r ggplot2 r-markdown kable