knitr:不同目录中的子文档 [英] knitr: child document in different directory
本文介绍了knitr:不同目录中的子文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果子文档位于同一目录中,则可以使用以下代码.
I can use the following code for child document if it is in the same directory.
<<child-demo, child=knitr-input-child.Rnw, eval=TRUE>>=
@
如果子文档不在主文档的同一目录中,我想知道如何使用它.预先感谢您的帮助和时间.
I wonder how to use child document if it is not in the same directory of master document. Thanks in advance for your help and time.
推荐答案
这可以视为错误.现在,我已在 GitHub 上修复了它.但是请注意,在使用knit()
之前,您需要先setwd()
到主文档的目录,否则knit()
可能找不到子inputdir/child.Rnw
.请查看开发版本是否适合您.谢谢!
This can be considered as a bug. Now I have fixed it on GitHub. Note, however, you need to setwd()
to the directory of your master document before using knit()
, otherwise knit()
may not be able to find a child inputdir/child.Rnw
. Please see if the development version works for you. Thanks!
这篇关于knitr:不同目录中的子文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文