Reputation: 21
I have two different R scripts. I love the idea of 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.
Upvotes: 1
Views: 259
Reputation: 2165
You can use the text
parameter in the spin
function. Use readLines
to read the files and then cat
to write the output:
cat (spin (text = c (readLines ("file_one.r"),
readLines ("file_two.r"))),
file = "output.html")
Upvotes: 4