Closed AugustT closed 8 years ago
I use R markdown with knitr a lot so happy to use it. If there's going to be some large analyses in it you just have to be careful how you set it up.
I use a switch at the top of the script runBigAnalysis <- TRUE
type thing. Then have the actual analysis in a chunk with eval = runBigAnalysis
and save outputs. Next chunk reads in the outputs.
Relying on the cache is annoying (it sometimes breaks).
I have always found caching works well, but your switch idea works well too.
If nothing else, if you accidentally add a space or something in the chunk you'll have to rerun the analysis. If it's a big analysis, that's really annoying.
I use caching for all the small bits though. Just not worth the risk for day long analyses.
Also, if someone wants to replicate the paper, relying on caches means they HAVE to run the big analysis. Writing out and reloading means they CAN run it if they wish.
Haha! Yeah I can see that being annoying!
Lets go with caching until we have a big analysis and then we can use your switch.
Once I get an OK from @goldingn I'll switch it over to .Rmd and move the dummy figure into the ms.Rmd script
Yep, go for it!
At present we are using markdown. If we use R markdown then we can place actual R code in the manuscript so that it is entirely reproducible (at the moment figures have to built by other scripts first). This also removes the need to have figure files floating about and we can just have the current version complied for reviewing. It also ensures that the code we demonstrate will work across a number of systems as between us we have OSX Windows and Linux covered.
I'm happy to make the changes if you think it is a good idea.