什么是等效于RStudio的Knit HTML的简洁命令行? [英] What is a neat command line equivalent to RStudio's Knit HTML?

查看:47
本文介绍了什么是等效于RStudio的Knit HTML的简洁命令行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是等效于RStudio的Knit HTML的简洁命令行?给定一个.Rmd文件,您可以使用RStudio通过Knitr编织.html.docx.pdf文件.最好将这个过程完全转移到命令行.到目前为止,我的方法:

What is a neat command line equivalent to RStudio's Knit HTML? Given an .Rmd file, you can use RStudio to knit .html, .docx and .pdf files using Knitr. It would be great to shift this process completely to the command line. My approach so far:

Rscript -e "library(knitr); knit('test.Rmd')"  # This creates test.md
pandoc test.md >> test.html

这可以很好地工作,但是生成的test.html与RStudio相比并没有漂亮的改头换面.任何建议如何最好地通过命令行将.Rmd文件编织到.html,并以漂亮的.html结尾?

This works fine, but the resulting test.html does not come with the same pretty make over as in RStudio. Any suggestions how one should best knit .Rmd files to .html via the command line, and end up with a pretty .html?

额外的问题:对于.pdf.docx,最佳的命令行解决方案是什么?

Extra question: What would be the best command line solution for .pdf or .docx?

推荐答案

rmarkdown::render("test.Rmd", "html_document")

这篇关于什么是等效于RStudio的Knit HTML的简洁命令行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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