繁体   English   中英

是否可以在两个不同的R脚本上调用knitr :: spin并生成一个单独的html文件?

[英]Is it possible to call knitr::spin on two different R scripts and produce a single html file?

我有两个不同的R脚本。 我喜欢knitr :: spin的想法。 我想知道是否有办法在这两个脚本上调用spin,这两个脚本都使用roxygen2格式化并生成一个报告。

您可以在spin函数中使用text参数。 使用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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM