Markdown prepopulated template suggestion

rmarkdown

#1

In my markdown documents, I use the following language to describe versions:

# Software versions and time stamps

Package `MCMCglmm` version `r packageVersion("MCMCglmm")` was used to fit Bayesian models. 
Analysis has been performed under R version `r getRversion()`. 
This document was compiled using `RMarkdown` version `r packageVersion("RMarkdown")`
and `knittr` version `r packageVersion("knitr")` on `r Sys.time()`.

For the benefit of others, I think it might be helpful to have something like that in the template that RStudio throws at you when you File/New File/R Markdown. I am sure it will be more commonly used than r summary(cars) and r plot(pressure) ;).


#2

This is a nice idea; it could maybe be an option, e.g. "do you want to use summary(cars) as the template, or “some other value” (or nothing). I think the summary... content is good for teaching, showing a user what to do, but once you know what you’re doing, the workflow might look something like “Open new Rmd, delete the initial content, carry on…” and there’s at least one step in there that could be omitted with an option setting.


#3

Yeah, I delete the summary(cars) right away, although I keep the “This is R Markdown” document (because I usually need to demonstrate to whomever I send this to that it is a data-based, easily reproducible and reprogrammable document).


#4

We get a lot of suggestions for changing the New R Markdown template, but there are very few patterns that are universally appealing (which is why it ships as a simple beginner-focused template).

If you want to set up a shortcut for yourself so that you can go to File New and create the template of your choice, it’s very straightforward to set up a named template you can re-use. Instructions here:

http://rmarkdown.rstudio.com/developer_document_templates.html

I agree that it’d be cool to be able to change the default templates, in addition to adding your own. Can’t promise we’ll have time to do this soon, but I’ve filed an issue here for consideration: