Markdown prepopulated template suggestion

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) ;).

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.

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).

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:

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:

https://github.com/rstudio/rstudio/issues/1632

5 Likes