In the very beginning, I planned to write this book with Markdown, but laterI changed my mind and wrote it in LyX instead. For those who are stillinterested in the Markdown source, please see the markdowndirectory.
Now this book has been published by Chapman &Hall. You can also findit on Amazon. There is abook review published in the Journal ofStatistical Software, which may give you a better idea of this book than myown introduction.
Besides the old Markdown source which is really only an empty sketch, thisrepository also provides the real source files for the first three chaptersof the book, so that you can learn how the book was written and quickly getstarted with writing books using the LaTeX style by Chapman & Hall.
The main file is DDR-Yihui-Xie-Chap1-3.lyx
; the Rnw fileDDR-Yihui-Xie-Chap1-3.Rnw
was exported from LyX; krantz.cls
is the LaTeXclass provided by Chapman & Hall, and I wrote a simple LyX layout filekrantz.layout
; DDR-Yihui-Xie.bib
contains some bibliography entries, andDDR-packages.bib
is dynamically generated from knitr (see the lastchunk in the LyX or Rnw file).
The PDF of the first three chapters can be downloadedhere
For Linux users, the minimal version of LyX for this book is 2.0.3 (as you canget from Debian). For Windows/Mac OS X users, just download the latest binariesfrom the LyX website. If you do not use LyX, you can simplyopen the Rnw file and start from there.
Be sure to read the session info in the preface because your R packages maynot be up-to-date to reproduce the PDF. Normally I use development versionsof my packages, because I often find little problems that I need to solvefor the book, and these changes will end up in the development versions.
GitHub issues (https://github.com/yihui/knitr-book/issues) is thepreferred way for feedbacks. You can also reach me by email if you reallywant:
echo oybuwycxy.trpb | tr bopcrbtucwxyc+ exmiaen@iyuih
knitr 是一个通用的文学编程引擎(literate programming),其轻量级的 API 旨在让用户完全控制输出,而无需繁重的编码工作。它将许多功能结合到一个包中,并根据作者对 Sweave 的日常使用进行了一些微调。 受 Sweave 启发,knitr 包被设计为一个使用 R 生成动态报告的透明引擎。Sweave 是文学编程的一种巧妙而新颖的实现,它的主要问题是难以扩展。 knitr
knitr examples This repository is a collection of knitr examples. It is both for my own test purpose and for other knitters to learn about this package. For each input file, there is an output file, e
问题内容: yihui给出了针对不同引擎使用cache选项的示例 https://github.com/yihui/knitr-examples/blob/master/023-engine- python.Rmd 我似乎无法使其适用于python。 以下作品 但这行不通 有人有主意吗? 问题答案: 块选项不会保存块中定义的除之外的所有语言变量。但是,这是保存打印输出的结果,因此,如果您计算需要花
我正在使用R rticles包中的Elsevier模板在Rstudio中生成pdf文档。对于这篇论文,我想包括一个.png图像。当我加载图像时 工作正常,但当我将其更改为等效的knitr命令时(我更喜欢这个命令,因为它更容易设置fig大小等)。 我得到以下错误: 当我在rmarkdown中切换到pdf的标准输出设置时,输出:pdf_document,knitr选项确实起作用,所以我猜问题一定与rt