Thanks so much for the response. Yes, I suppose I want to have my cake and eat it too. I prefer working with/developing my code in Rmd files over R scripts (not talking about writing packages or functions here. Talking about analysis projects, e.g., data_01_import.Rmd, data_02_merge.Rmd, data_03_clean.Rmd, analysis_01_descriptive.Rmd, etc.). Once they are developed, however, it would sometimes useful to be able to just execute them as an R script (i.e.,
source(my_file.Rmd) -- which, of course, doesn't work).
In the past, I've tried maintaining an Rmd file for interactive experimentation/data checking and manually tried to mirror key elements of the Rmd file in a separate R script. But, maintaining two files is obviously not ideal. I was totally unaware of
knitr::purl(), so thank you very much for pointing me to that!!
I suppose that in a perfect world I would still prefer something equivalent to
knitr::purl() seems like the next best thing.