我该如何在pdf文档中显示来自rmarkdown脚本的DT::datatable对象?到目前为止,我的代码出现以下错误:
在YAML头中包含
感谢任何帮助。 我目前的代码是:
processing file: reportCopy.Rmd
output file: reportCopy.knit.md
Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML.
在YAML头中包含
always_allow_html: yes
可以抑制错误,但是pdf上没有任何内容显示。感谢任何帮助。 我目前的代码是:
---
title: "DT"
output: pdf_document
---
### Chart 1
```{r}
DT::datatable(head(mtcars))
```
我不知道这是否重要,但我的datatables实际上是在一个shiny
应用程序中创建的。理想情况下,我希望将预呈现的表格简单地转储到rmarkdown
脚本中...但我改变了策略,现在尝试直接在rmarkdown
代码中呈现表格。
knitr::kable
。 - Adam Spannbauerpdf_document
中使用datatable
(因为datatable
是交互式的),只能在html_document
中使用!在 PDF 中唯一的可能性是使用kable
或者例如pandoc.table
。 - Mal_a