r - 有没有办法在代码中定义所有 Sweave 选项?

标签 r sweave

引用 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/

相关文章:

r - ggplot2 - boxplot 多个 data.frames 同时保持秩序

格式化 Sweave 表,两个挑战

r - 当 .Rnw 有一个带有 "results"选项的 block 时,R 中的 Sweave 函数失败

r - Dynamic Sweave 文档

r - 如何抑制 Sweave 中未被 echo=FALSE 抑制的输出?

python - Scikit Learn 随机森林分类器 : How to produce a plot of OOB error against number of trees

r - "' knitr ' not found"打包/小插图构建期间的错误

从 R 中的列表列表中删除元素

r - R中非常快速的字符串模糊匹配

r - 从源加载脚本时,无效的多字节字符崩溃(元音变音/特殊字符)