麻麻说我们可以用 R Markdown 写书了
2022-05-07
前言
你好,世界。我写了一本书。这本书是这样的,第 1 章介绍了啥啥,第 2 章说了啥啥,然后是啥啥……
我用了两个 R 包编译这本书,分别是 knitr (Xie 2015) 和 bookdown (Xie 2022)。以下是我的 R 进程信息:
sessionInfo()
## R version 4.1.0 (2021-05-18)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19044)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=Chinese (Simplified)_China.936
## [2] LC_CTYPE=Chinese (Simplified)_China.936
## [3] LC_MONETARY=Chinese (Simplified)_China.936
## [4] LC_NUMERIC=C
## [5] LC_TIME=Chinese (Simplified)_China.936
##
## attached base packages:
## [1] stats graphics grDevices utils datasets
## [6] methods base
##
## loaded via a namespace (and not attached):
## [1] bookdown_0.26 digest_0.6.29 R6_2.5.1
## [4] jsonlite_1.8.0 magrittr_2.0.1 evaluate_0.15
## [7] stringi_1.6.1 rlang_0.4.11 rstudioapi_0.13
## [10] jquerylib_0.1.4 bslib_0.3.1 rmarkdown_2.14
## [13] tools_4.1.0 stringr_1.4.0 xfun_0.30
## [16] yaml_2.3.5 fastmap_1.1.0 compiler_4.1.0
## [19] htmltools_0.5.2 knitr_1.39 sass_0.4.1
参考文献
Xie, Yihui. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. http://yihui.name/knitr/.
———. 2022. Bookdown: Authoring Books and Technical Documents with r Markdown. https://CRAN.R-project.org/package=bookdown.