I have a .Rmd file called f1.Rmd
(containing a mix of text and R chunks) and an R script called f2.R
.
I would like to insert a set of R instructions in f2.R
that would execute all the R chunks contained in f1.Rmd
, in such a way that all variables created in f1.Rmd
would be created in my current R session if I source f2.R
(similarly to what happens when clicking on "Run" -> "Run all chunks below from the Rstudio menu").