标签: r knitr r-markdown
--- title: "Untitled" output: html_document --- ```{r setup, include=FALSE} library(DT) xsx = function(){ print(getOption("viewer")) print(datatable(data.frame(d =1))) 1 } xsx() ```
在xsx()函数内部,DT小部件不会在HTML结果中呈现。如何在函数内打印小部件?