my package/library cannot be deployed into my shiny app

Hello world!
I am developing an app for my work, in which I use ctsmr package, the package is developed in DTU and it has not been included in CRAN yet. Now, when I runApp on my laptop it works but when I go to publish it on shinyApps.io i receive following errors.

- Error: Unhandled Exception: Child Task 639552174 failed: Error building image: Error fetching ctsmr (0.6.17) source. <CRANPackageSource repo='http://cran.rstudio.org'> unable to satisfy package: ctsmr (0.6.17).

- In FUN(X[[i]], ...) :
  Package 'ctsmr 0.6.17' was installed from sources; Packrat will assume this package is available from a CRAN-like repository during future restores. 
- 
- > rsconnect::appDependencies()
       package  version source
1           BH 1.69.0-1   CRAN
2           R6    2.4.0   CRAN
3         Rcpp    1.0.2   CRAN
4       crayon    1.3.4   CRAN
5        ctsmr   0.6.17   CRAN
6       digest   0.6.20   CRAN
7    htmltools    0.3.6   CRAN
8       httpuv    1.5.1   CRAN
9     jsonlite      1.6   CRAN
10       later    0.8.0   CRAN
11    magrittr      1.5   CRAN
12        mime      0.7   CRAN
13    promises    1.0.1   CRAN
14       rlang    0.4.0   CRAN
15       shiny    1.3.2   CRAN
16 sourcetools    0.1.7   CRAN
17      xtable    1.8-4   CRAN
Warning messages:
1: In FUN(X[[i]], ...) :
  Package 'ctsmr 0.6.17' was installed from sources; Packrat will assume this package is available from a CRAN-like repository during future restores

I downloaded the package from: http://ctsm.info/repo/dev/bin/
thank you very much

From the documentation, you can deploy an application with a private package only if from Github

Package sources
Currently, the shinyapps.io service supports deploying packages installed from CRAN, GitHub (both public and private repos), and BioConductor.

(...)

Support for R-Forge and other repos is on our backlog; please drop us a line in the shinyapps.io Community if the lack of support is a blocker for you.

One (dirty) trick would be to included the source code of your package in a folder of your app and use pkgload::load_all(path= "folder-with-pkg-code"). Depending on your package (Compile code or just R code for example), I think this would work. we used this trick in development version of our apps.

Otherwise, you need to use another way than shinyapps.io to host your app.

Hope it helps

3 Likes

Thank you very much for your answer.
It was quite useful, with the dirty method ( :wink: ) I solved the problem for uploading the package, but when I use loadpkg some main functions are missed on the shiny server.
So I cannot run my code probably.

Is there any solution for that.

Thank you very much

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