用命令编译.Rnw文件 [英] Compile .Rnw file with command

查看:86
本文介绍了用命令编译.Rnw文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.Rnw文件,可以为我生成一个报告.在RStudio中,您可以使用编译PDF"按钮对其进行编译.

I have .Rnw file which generates me a report. In RStudio you compile it with button 'Compile PDF'.

但是有没有一种方法可以通过脚本中的命令编译该文件并传递一个字符变量?

But is there a way to compile this file with command in script and pass one character variable?

我尝试使用功能knit(),但它只生成.tex文件,我也想获取pdf.

I tried to use function knit() but it only produces .tex file and I would like to obtain also pdf.

谢谢您的帮助!

推荐答案

knitr包中的函数knit2pdf起到了作用;)

The function knit2pdf in the knitr package does the trick ;)

这篇关于用命令编译.Rnw文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆