CredibilityLab / groundhog

Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
https://groundhogr.com/
GNU General Public License v3.0
78 stars 4 forks source link

ability to use with a shiny app deployed to shinyapps.io #110

Closed adamcohen3 closed 12 months ago

adamcohen3 commented 12 months ago

I'm pretty sure this isn't currently possible, but is there a way to use groundhog with a shiny app deployed to shinyapps.io? I'm guessing this might take a bit of work on the development side (and maybe collaboration with Posit?), but it's the only thing preventing me from using groundhog, which I think is a great package and far more intuitive and user-friendly than renv. Thanks for your consideration.

urisohn commented 12 months ago

i don't use shiny apps so am not sure. when you try to rely on groundhog in the app, do you get an error? I don't know how pkg management works there, where are pkgs stored for the app.?

adamcohen3 commented 12 months ago

Yeah, it errors.

The clearest, simplest explanation of package management with shinyapps.io is here: https://docs.posit.co/shinyapps.io/getting-started.html#using-your-r-packages-in-the-cloud

Key part here:

When you deploy your application, the rsconnect package detects the packages that your application uses by looking for explicit library() calls within your application. Be aware that you should not have an explicit install.packages() call within your ui.R or server.R files.

During deployment, the rsconnect package sends the R version, the list of packages and their dependencies, and your application to shinyapps.io. shinyapps.io then builds and installs the packages into the R library for your application. The first time you deploy your application, it may take some time to build these packages (depending on how many packages are used). However, you will not have to wait for these packages to build during future deployments (unless you upgrade or downgrade a package, or you upgrade to a newer version of R).

urisohn commented 12 months ago

OK, i can't help, this requires additional knowledge I don't have, sorry.