CrumpLab / vertical

R workflow for sharing psychological research
https://crumplab.github.io/vertical/
Other
35 stars 2 forks source link

vertical_project() could open RStudio project template #42

Closed CrumpLab closed 4 years ago

CrumpLab commented 4 years ago

I like the new vertical_project() function, and I think I agree with eliminating support for installing in an existing project, that could easily create more problems.

I wonder about adding support for the following, with no path specified.

vertical_project()

I'm thinking we could set path=NULL as the default, then check that and if true, run

rstudioapi::executeCommand('newProject', quiet = FALSE)

This would load the RStudio project template viewer and the user could take it from there. It makes the quick start documentation easier, which would read something like this:

vertical_project()
build_vertical()
mvuorre commented 4 years ago

Sounds good. Generally, I don't mind basically depending on RStudio, but I guess it's best practices to ensure that functions also work outside it.

CrumpLab commented 4 years ago

I have a version of this in the testbuild branch, I added:

if(is.null(path)) {
    rstudioapi::executeCommand('newProject', quiet = FALSE)
    return(usethis::ui_info("Opening RStudio Project Template, select New Directory, then Vertical Research Project"))
  }

to the beginning of vertical_project(), and set path=NULL as the default. The result is that vertical_project() loads the R studio template window from the console. It's a simple thing, and it doesn't break anything else. if you have no objections, I'll add it to the master

mvuorre commented 4 years ago

Great! This is now reflected in the master branch.