-
Notifications
You must be signed in to change notification settings - Fork 85
Description
I like to use pacman for loading packages, because I can write this and share my code to others.
if (!require("pacman")) install.packages("pacman")
pacman::p_load(shiny, DT, data.table)
They can just run the code and install packages they don't have automatically. If I used library() they will need to find every missing package and install them manually before the script can work.
However this doesn't work when deployed to shinyapps.io. Because shinyapps only look for library to install packages, and there is a explicit install.packages call in the script which is not allowed in shinyapps.
Right now I'm deploying my shiny apps both in shinyapps.io and github. People can run my app in github directly with shiny::runGitHub. Because of this limit, I cannot use the pacman lines in my code which make the github deployment less perfect.
Is it possible to extend shinyapps to support this usage? It should not be hard, just
- ignore the install.packages line since it will never success anyway
- scan the packages in this script. Just add
pacmanand all packages appeared inp_loadcall to the packages dependency list.
Thanks!