![](/img/trans.png)
[英]RStudio, knitr, pandoc, Word: how do I get a 'new page' in my docx?
[英]Paths in ssh versus Rstudio server for pandoc and knitr
我使用预制的AMI( http://www.louisaslett.com/RStudio_AMI/ )运行Rstudio AWS实例。 使用此我可以启动到rstudio服务器。 我可以创建一个默认的.Rmd文件并编织没有问题。 我在最后得到了正常的消息(粘贴,路径可能是相关的)。
/usr/lib/rstudio-server/bin/pandoc/pandoc +RTS -K512m -RTS test.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template /usr/local/lib/R/site-library/rmarkdown/rmd/h/default.html --variable 'theme:bootstrap' --include-in-header /tmp/RtmpeN2em3/rmarkdown-str156c3b3566c1.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --no-highlight --variable highlightjs=/usr/local/lib/R/site-library/rmarkdown/rmd/h/highlight
此外,我可以去shell rstudio选项工具 - > shell和类型
Rscript -e "rmarkdown::render("test.html")"
而且编织得很好。
但是,当我ssh到同一个实例(git bash终端),并尝试使用相同的代码行渲染相同的文档。 我明白了:
ubuntu@ip-172-31-17-88:/home/rstudio$ Rscript -e "rmarkdown::render("test.html")"
Error: pandoc version 1.12.3 or higher is required and was not found.
Execution halted
在ssh中是否有关于我误解的路径的行为?
如果我输入:
pandoc
The program 'pandoc' is currently not installed. You can install it by typing:
sudo apt-get install pandoc
那么rstudio服务器如何能够编织到HTML?
RStudio将环境变量RSTUDIO_PANDOC
设置为包含RStudio IDE / Server附带的pandoc
二进制文件的目录。 当你调用rmarkdown::render()
, rmarkdown试图从这个环境变量中找到pandoc
。
当然,当您在RStudio IDE / Server中运行程序时,此环境变量存在,但不太可能在RStudio外部设置。 您可以将RStudio pandoc目录添加到PATH
,也可以运行RStudio中的所有内容。
PATH=/usr/lib/rstudio-server/bin/pandoc/:$PATH Rscript -e "rmarkdown::render("test.Rmd")"
你当然可以通过apt-get install
自己安装Pandoc,但我不确定你的Ubuntu发行版中是否存在足够版本的Pandoc。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.