【发布时间】:2021-02-12 18:53:07
【问题描述】:
我正在尝试将静态 DT 呈现为 word。
我有一个文件example.Rmd 的精简版本,我正在使用knitr 1.30 版和所有相关软件包的最新稳定版本。根据https://bookdown.org/yihui/bookdown/html-widgets.html datatable 应该呈现,但我没有得到静态DT 只是echo=TRUE 部分。
如果可以的话,请帮助我 - 我被困住了,我不能只使用另一张桌子。
title: 'Main title'
subtitle: 'Subtitle here'
always_allow_html: yes
# params:these will come from SHINY APP
# x1: x1
# x2: x2
# x3 :x3
output:
word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(out.width = '100%', dpi=300)
```
```{r, fig.align='center', echo=TRUE, cache=FALSE, warning = TRUE, message = TRUE, tidy=TRUE}
library(DT)
library(webshot)
if(is.null(webshot:::find_phantom())){webshot::install_phantomjs()}
DT::renderDataTable(iris)
```
【问题讨论】:
标签: datatables r-markdown knitr dt