Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does packrat work on shiny server?

It seems weird to me that my shiny app runs fine when I run from Rstudio but same project, when ran on shiny server (open source), does not use packrat private library. I used .libPaths() to check and the private library does not show. Do I need to do any configuration to make it work? Thanks.

paste0(.libPaths(),' shinyBS version:',as.character(packageVersion('shinyBS')))

On Rstudio

[1] "C:/R/ADAP/packrat/lib/i386-w64-mingw32/3.1.1 shinyBS version:0.25"
[2] "C:/R/ADAP/packrat/lib-ext shinyBS version:0.25"                   
[3] "C:/R/ADAP/packrat/lib-R shinyBS version:0.25"

On Shiny Server

shinyBS version:0.20 Lib:/usr/lib64/R/library shinyBS version:0.20 Lib:/usr/share/R/library
like image 221
Xiushi Le Avatar asked Oct 20 '22 23:10

Xiushi Le


1 Answers

There is a config file .Renviron and in it contains an environment variable R_LIBS. This is where your R session (and .libPaths()) learns where to look for libraries. To change the default, do not edit the .Renviron file directly, but instead create a copy in the same directory and name it .Renviron.site. Edit the R_LIBS variable in this new file. This prevents your config changes from being overwritten by the installer on upgrades.

like image 109
user2019975 Avatar answered Oct 23 '22 07:10

user2019975