引用 pgfSweave 手册:
How do I set subdirectories for gures and caches? This is straight out of the Sweave and cacheSweave manuals (nothing new here). For a figures subdirectory use the prefix.string option:
\SweaveOpts{prefix.string=figs/fig}
For a caching subdirectory use a code chunk at the beginning or your document like:
<<setup,echo=F>>=
setCacheDir("cache")
@
我觉得这两个选项在不同的地方很烦人,R 代码与 latex 指令。有没有办法设置
prefix.string
带有 R 代码的选项,可能在 Sweave
之前叫做?
最佳答案
可以使用 \SweaveOpts
全局设置 Sweave 选项。或调用Sweave
, 像这样:
Sweave("tmp.Rnw", prefix.string="figs/figs")
关于r - 有没有办法在代码中定义所有 Sweave 选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7759914/