I'm following this short tutorial to print my R script directly as an HTML document. It should be pretty straightforward. With a few small changes to the header and comments of an otherwise normal R script, calling the command
rmarkdown::render('/Users/you/Documents/yourscript.R')
at the end of an R script should call the knitr::spin
function to go from my R script to an Rmd file to the final HTML or PDF.
I'm getting the error:
Error in sink(con, split = debug) : sink stack is full
and I'm not sure what to do. All solutions I've found online point out that one needs to close sink()'s after opening them. But since I'm not really using sink()
myself, I don't see how or where I should close them.
I'm using R 3.3.0.
This Question asks the same but is downvoted and has no answers.
rmarkdown::render()
command in a chunk in the doc itself so you can easily run it and knit to all formats, just put the chunk optioneval=FALSE
in the chunk header. This way it won't recursively run that command when knitting the doc itself. – Subaqueous