在 RMarkdown 的 PDF 输出中旋转一个多页的表格 [英] Rotating a table in PDF output from RMarkdown with more than one page
本文介绍了在 RMarkdown 的 PDF 输出中旋转一个多页的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的 PDF 输出中旋转一个宽表.我遇到了
所以我的问题很简单:我们如何通过将表格分成几部分来创建所需数量的 PDF 页面?
解决方案
你可以试试这个(抱歉我不能评论):
dt <- iriskable(dt,乳胶",longtable = T,标题=标题")%>%kable_styling(font_size = 7, latex_options = c("repeat_header"),repeat_header_text = "",full_width = F) %>% kableExtra::landscape()
这似乎对我有用.结果如下:pdf 输出是你想要的吗?
I want to rotate a wide table in my PDF output. I came across this fantastic question, but my table is longer.
When I copy/paste one of the examples shown in that question, it works nice using RMarkdown.
library(kableExtra)
kable(iris[1:5,],
format = "latex", booktabs = TRUE) %>%
kableExtra::landscape()
However, if we remove the subsetting we see that the table exceeds the dimension of the page.
library(kableExtra)
kable(iris,
format = "latex", booktabs = TRUE) %>%
kableExtra::landscape()
So my question is very simple: how can we create as many PDF pages as needed by splitting the table in parts?
解决方案
Can you try this (sorry I can't comment) :
dt <- iris
kable(dt, "latex", longtable = T, caption = "title") %>%
kable_styling(font_size = 7, latex_options = c("repeat_header"),repeat_header_text = "",
full_width = F) %>% kableExtra::landscape()
This seems to work for me. Here's the result : pdf output Is it what you want?
这篇关于在 RMarkdown 的 PDF 输出中旋转一个多页的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文