Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个不同的 R 脚本。我喜欢 knitr::spin 的想法。我想知道是否有一种方法可以在这两个脚本上调用 spin,它们都使用 roxygen2 格式化并生成一个报告。
您可以text在函数中使用参数spin。用于readLines读取文件,然后cat写入输出:
text
spin
readLines
cat
cat (spin (text = c (readLines ("file_one.r"), readLines ("file_two.r"))), file = "output.html")