【发布时间】:2013-07-11 12:53:06
【问题描述】:
我知道这可以用 php 和其他语言完成,但想知道是否可以使用 knitr 完成以下操作:
假设我有一个包含两个标题 1 部分的 Rmarkdown (.rmd) 文档:
# This is the first heading for the first document
Lorem ipsum dolor sit amet
# This is the second heading for the first document
plot(object)
-
问题 1:如果打开另一个 .rmd 文档,我如何创建一个链接,以便在解析该文档时显示其内容以及第一个文档的全部内容。例如:
# This is the first heading for the second document Lorem ipsum dolor sit amet [command goes here to insert the first document]结果是:
# This is the first heading for the second document Lorem ipsum dolor sit amet # This is the first heading for the first document Lorem ipsum dolor sit amet # This is the second heading for the first document [plot shows up here] 问题 2:knitr 是否允许我仅选择文档 1 的选定部分并将其插入到文档 2 中?比如只有标题1和它下面的内容,或者只有标题2和它的情节
【问题讨论】:
-
您可以通过子文档做第一件事。见this。第二个比较棘手,取决于您如何定义应该显示的内容和不应该显示的内容。
标签: r markdown knitr r-markdown