Closed benmarwick closed 1 year ago
I think this is a really cool idea and is compatible with the rrtools package philosophy. I tested this out a bit and while successful in creating a template and launching a new rrtools package, ran into the obvious hurdle. The way in which rrtools
starts a new RStudio session after use_compendium()
breaks the function sequence. Briefly, here are the ways that I came up with to approach this (by no means the only ways):
use_compendium()
and subsequent functions based on selections in UI.use_compendium()
that includes calls to subsequent functions based on parameters passed to it from the UISo how is that working out?
use_compendium()
is called, any subsequent function calls in the init
functions error.init
function and run subsequent setup function (e.g. use_travis()
) to create the project as selected in the UI.So there is room to work here and I will keep at it.
Great progress thanks to the answers here: (I went with option 3 from above, but others are still possible) https://community.rstudio.com/t/project-templates-and-rprofile/82
I have it working successfully to open the project template UI, select some options, the init
script then digests the UI options and writes two file 1) ProjectTemplate
a simple record of all the options passed from the UI, 2) a .Rprofile
file that executes the subsequent rrtools
functions and then renames itself to archive the setup script without interfering with operations later on.
TO DO now is to get all the options in the UI and right the logic to test/check them.
issues:
rrtools
could get in the wayrrtools
setups.Thanks for these updates, this is great. Seems like RStudio 1.1 isn't quite ready for me, as I encounter a few problems when trying this template:
Some problem when creating from the template:
Click OK and get another problem:
Try opening the project from the .RProj file that was created:
I guess I need to wait for RStudio 1.1 to be more mature before I can enjoy this.
@mrecos it might be that RStudio is more robust with pkg templates now, would you like to see this can work now? Thank you!
Following Matt's suggestion, consider this: https://rstudio.github.io/rstudio-extensions/rstudio_project_templates.html