我想从一个R脚本运行sweave。Rnw文件位于我的项目目录下的Rnw目录中。我试过了
system("Rnw/compilePDF.Rnw")并得到了这样的回应。
sh: Rnw/compilePDF.Rnw: Permission denied.Rnw文件的权限是-rw-r--r--但我怀疑这不是问题所在。
发布于 2016-12-07 02:10:42
解决方案是包含以下代码。编码是必需的,因为Sweave的默认值是ASCII,并为此返回一个错误。
Sweave("Rnw/compilePDF.Rnw", encoding = "UTF-8")该命令的输出为
Writing to file compilePDF.tex
Processing code chunks with options ...
You can now run (pdf)latex on ‘compilePDF.tex’要将此格式转换为pdf格式,请使用
tools::texi2pdf("Rnw/compilePDF.tex")https://stackoverflow.com/questions/41002064
复制相似问题