[英]Is it possible to call knitr::spin on two different R scripts and produce a single html file?
I have two different R scripts. 我有两个不同的R脚本。 I love the idea of knitr::spin.
我喜欢knitr :: spin的想法。 I wanted to know if there's a way to call spin on these two scripts which are both formatted with roxygen2 and produce a single report.
我想知道是否有办法在这两个脚本上调用spin,这两个脚本都使用roxygen2格式化并生成一个报告。
You can use the text
parameter in the spin
function. 您可以在
spin
函数中使用text
参数。 Use readLines
to read the files and then cat
to write the output: 使用
readLines
读取文件然后cat
写入输出:
cat (spin (text = c (readLines ("file_one.r"),
readLines ("file_two.r"))),
file = "output.html")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.