gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 12:28:12 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com