Deploying App using custom package from public GitHub repo

library(devtools)
if(require(statsguRu)==FALSE)
devtools::install_github("npranav10/statsguRu")
library(shiny)
The above 4 lines are my first 4 in the shiny ui R file. The image attached herewith shows an error ,which i am confused about whats the point of error occurrence

https://npranav10.shinyapps.io/statsguRu/
Error:

Shinyapps.io log
2019-05-12T13:29:03.840171+00:00 shinyapps[925071]: Server version: 1.7.2-7
2019-05-12T13:29:03.840174+00:00 shinyapps[925071]: LANG: en_US.UTF-8
2019-05-12T13:29:03.840213+00:00 shinyapps[925071]: shiny version: 1.3.2
2019-05-12T13:29:03.840211+00:00 shinyapps[925071]: R version: 3.6.0
2019-05-12T13:29:03.840216+00:00 shinyapps[925071]: knitr version: NA
2019-05-12T13:29:03.840217+00:00 shinyapps[925071]: jsonlite version: 1.6
2019-05-12T13:29:03.840214+00:00 shinyapps[925071]: httpuv version: 1.5.1
2019-05-12T13:29:03.840224+00:00 shinyapps[925071]: htmltools version: 0.3.6
2019-05-12T13:29:03.840215+00:00 shinyapps[925071]: rmarkdown version: NA
2019-05-12T13:29:03.840402+00:00 shinyapps[925071]: Using pandoc at /opt/connect/ext/pandoc2
2019-05-12T13:29:03.840223+00:00 shinyapps[925071]: RJSONIO version: NA
2019-05-12T13:29:03.984888+00:00 shinyapps[925071]: Using jsonlite for JSON processing
2019-05-12T13:29:03.989935+00:00 shinyapps[925071]:
2019-05-12T13:29:03.989937+00:00 shinyapps[925071]: Starting R with process ID: '20'
2019-05-12T13:29:04.581828+00:00 shinyapps[925071]: Loading required package: statsguRu
2019-05-12T13:29:04.582101+00:00 shinyapps[925071]: Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
2019-05-12T13:29:04.582103+00:00 shinyapps[925071]: there is no package called ‘statsguRu’
2019-05-12T13:29:04.737411+00:00 shinyapps[925071]: Downloading GitHub repo npranav10/statsguRu@master
2019-05-12T13:29:06.930752+00:00 shinyapps[925071]: processx (3.3.0 -> 3.3.1) [CRAN]
2019-05-12T13:29:06.930754+00:00 shinyapps[925071]: rcmdcheck (1.3.2 -> 1.3.3) [CRAN]
2019-05-12T13:29:06.933149+00:00 shinyapps[925071]: Installing 2 packages: processx, rcmdcheck
2019-05-12T13:29:06.944186+00:00 shinyapps[925071]: Error in value[3L] :
2019-05-12T13:29:06.944189+00:00 shinyapps[925071]: (converted from warning) 'lib = "/opt/R/3.6.0/lib/R/library"' is not writable
2019-05-12T13:29:06.944190+00:00 shinyapps[925071]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
2019-05-12T13:29:06.944191+00:00 shinyapps[925071]: Execution halted

Any solution would be really helpful for me!

You should not install a package from your application. rsconnect will now how to find the version of your used package, and generate the correct manifest so that the correct version is installed on the server.

So your app shouldn't install anything. The message says that it does not have the right to write to library.

So

  1. Use devtools::install_github("npranav10/statsguRu") locally to install the version of the package you want
  2. Replace
library(devtools)
if(require(statsguRu)==FALSE)
devtools::install_github("npranav10/statsguRu")
library(shiny)

by

library(statsguRu)
library(shiny)

rsconnect will parse the code before deploying, then the package will be installed on the server.
See
https://docs.rstudio.com/shinyapps.io/getting-started.html#using-your-r-packages-in-the-cloud

Hope it helps

2 Likes

Thanks a lot @cderv.
It was really a timely help , I had some more minor issues (i published all the package files along with shiny file, so it was still showing "unable to load statsguRu", later realized that i should be publishing only the r file) .

Now it works like a charm!.
Thanks again.

1 Like

If your question's been answered , would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.