我正在尝试创建一个表(以包含在 MSFT Word 表中),就像此处找到的表一样:
https://github.com/dcomtois/summarytools
3 - descr() : 描述性单变量统计
然而,
descr(iris, style = "rmarkdown")
style = "rmarkdown" is actually set as an st_options() - see below
如文中所示,不创建文档中的表格。
view(descr(iris, style = "rmarkdown"))
DOES 创建文档中的表格 - 如下所示。
view(descr(iris), "browser")
print(descr(iris), "browser")
view(descr(iris), "viewer")
print(descr(iris), "viewer")
以下以“将 pander 与 knitr 一起使用”的形式创建表格(请参阅:http ://rapporter.github.io/pander/knitr.html )
view(descr(iris), "pander")
print(descr(iris), "pander")
据我所知(此时),我需要学习 knitr ( https://yihui.name/knitr/ ) - 努力学习。
冒着过于冗长的风险,这是我的“环境”:
R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) library(summarytools) library(dplyr) library(data.table) library(pander) library(knitr) library(rmarkdown)
<<<<<< 来源在开始
st_options(bootstrap.css = FALSE, # Already part of the theme so no need for it
plain.ascii = FALSE, # One of the essential settings
style = "rmarkdown", # Idem.
dfSummary.silent = TRUE, # Suppresses messages about temporary files
footnote = NA, # Keeping the results minimalistic
subtitle.emphasis = FALSE) # For the vignette theme, this gives much better results.
st_css()
library(knitr)
opts_chunk$set(comment = NA, prompt = FALSE, cache = FALSE, echo = TRUE, results = 'asis')
library(tables)