【发布时间】:2019-01-03 15:23:03
【问题描述】:
我想将多个kable 表合并到一个图像中。
比如:
library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:4]
# first table
table1 <- kable(dt, format = "html", caption = "Demo Table") %>%
kable_styling(bootstrap_options = "striped",
full_width = F) %>%
add_header_above(c(" ", "Group 1" = 2, "Group 2[note]" = 2)) %>%
add_footnote(c("table footnote"))
# second table
table2 <- kable(dt, format = "html", caption = "Demo Table") %>%
kable_styling(bootstrap_options = "striped",
full_width = F) %>%
add_header_above(c(" ", "Group 1" = 2, "Group 2[note]" = 2)) %>%
add_footnote(c("table footnote"))
并将table1 放在图像中的table2 之上:
bind_rows(table1, table2) %>%
kable_as_image(., filename = 'P:/mytable/table')
但是,这不起作用。我怎样才能做到这一点? 谢谢!
【问题讨论】: