作者:Yihui Xie
译者:郑宝童
日期:2021.05.13
Software information and conventions
软件信息和约定
This book is primarily about the R package bookdown, so you need to at least install R and the bookdown package. However, your book does not have to be related to the R language at all. It can use other computing languages (C++, SQL, Python, and so on; see Appendix B), and it can even be totally irrelevant to computing (e.g., you can write a novel, or a collection of poems). The software tools required to build a book are introduced in Appendix A.
这本书主要是关于R包 bookdown的,所以您至少需要安装R和 bookdown包。然而,你的书可以根本不与R语言相关。它可以使用其他计算语言(c++, SQL, Python,等等;(参见附录 B)),它甚至可以与计算机完全无关(例如,你可以写一部小说,或一本诗集)。附录A中介绍了构建一本书所需的软件工具。
The R session information when compiling this book is shown below:
编写本书时的R session 信息如下所示:
sessionInfo()
## R version 4.0.5 (2021-03-31)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.7
##
## Matrix products: default
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets
## [6] methods base
##
## loaded via a namespace (and not attached):
## [1] knitr_1.33 tools_4.0.5
## [3] miniUI_0.1.1.1 htmltools_0.5.1.1
## [5] bookdown_0.22.2 shiny_1.6.0
## [7] rmarkdown_2.8
We do not add prompts (>
and +
) to R source code in this book, and we comment out the text output with two hashes ##
by default, as you can see from the R session information above. This is for your convenience when you want to copy and run the code (the text output will be ignored since it is commented out). Package names are in bold text (e.g., rmarkdown), and inline code and filenames are formatted in a typewriter font (e.g., knitr::knit('foo.Rmd')
). Function names are followed by parentheses (e.g., bookdown::render_book()
). The double-colon operator ::
means accessing an object from a package.
在本书中,我们不向R源代码添加提示符(>
和+
) ,并且默认使用两个##注释掉文本输出,正如您从上面的R session信息中可以看到的那样。这是为了方便您复制和运行代码(文本输出将被忽略,因为它被注释掉了)。包名是粗体文本(例如,rmarkdown),inline代码和文件名格式化为typewriter font(例如 knitr::knit('foo.Rmd')
)。函数名后面跟着括号(例如bookdown::render_book()
)。双冒号操作符 ::
表示从包中访问对象