Background:
I like 'r'. I use Rstudio for it - it is a nice IDE. I use the revolution Analytics version of 'r', "revolution R Open".
I find that I type the same stuff in the annotation and structured programming regularly, and I want to save myself the re-typing.
Question:
How do I change the default file template so that the one I want, with some text already populated, comes up when I create a new blank R-script in Rstudio.
Clarifications:
- I am not looking for this to be a manual process where I open one file, renaming it to a proper directory, and then work on it. I am looking to change the default so that this happens automatically.
Previous approach:
- rstudio search (example)
- search on stack-overflow
- poking around rstudio menus/preferences
Thanks.
It was made possible to define user and system-wide templates for several file types with rstudio v1.3
A few gotchas:
so, in this case, create a file called
~/.config/rstudio/templates/default.Ror/etc/rstudio/templates/default.Rfor a user or system-wide.Rfile template, respectively.I think this a 'less manual' solution than the accepted answer