Is it possible to take the rmarkdown file, programmatically manipulate the chunk parameters, and then knit based on the changed document?
I have some rmarkdown files that I want to use purl , including all the code (even those that have eval=FALSE ).
At this point, I think that I could (1) use sed to switch eval=FALSE to eval=TRUE , and then (2) purl . But I would like if there was something nicer, for example, maybe, for example:
parsed_rmd <- knitr::parse_rmd('my_rmarkdown.rmd') for (chunk in parsed_rmd) { chunk$eval <- TRUE } knitr::purl(parsed_rmd, output = 'my_rmarkdown_as_r.R'
source share