我通过 Sweave 生成每日报告。我想在 PDF 名称中附加当前日期,格式为 YYYYMMDD。我使用以下代码来生成文件:
rnwfile <- system.file("Sweave", "Margin.Rnw", package = "utils")
Sweave(rnwfile)
tools::texi2pdf("Margin.tex")
Margin.Rnw 是我想要生成的报告的主副本(将 LaTeX 与 R 代码混合)。我得到的输出是一个文件保证金.pdf。我想要一个名为 *Margin_YYYYMMDD.pdf* 的文件。
如果您有任何建议,我将不胜感激。
See the output
论证?RweaveLatex
.
这是未经测试的,但应该(?)工作:
rnwfile <- system.file("Sweave", "Margin.Rnw", package = "utils")
outfn <- paste0("Margin_",format(Sys.time(),"%Y%m%d"),".tex")
Sweave(rnwfile,output=outfn)
tools::texi2pdf(outfn)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)