I am trying to create a web application using shiny. It requires me to load a package I have installed on my computer. For example:
## Contents ui.R:
library
Here might be a solution that doesn't mess up with the system library. Put the following code at the beginning of the server.R.
user <- unname(Sys.info()["user"])
if (user == "shiny") {
# Set library locations
.libPaths(c(
"/path/to/your/own/library"
)
)
}
This lets Shiny look for packages installed in your own library preferentially and also keeps the packages you use to develop the app and the packages used when the app is deployed in sync.
Note that you may need to tweak permissions of your library folder for the shiny user to see it properly. Otherwise it will fail to look into your specified location without any error message.