What to do when a package is not available

227 views
Skip to first unread message

Jul R

unread,
Jun 2, 2018, 6:35:55 PM6/2/18
to shinyapps.io Users

Hello everyone: 

I am trying to deploy an application that in the server file loads some librarys:

library(shiny)
library(ggplot2)
library(ggimage)
library(grid)
library(png)
library(leaflet)
library(raster)

As far as I know, the package 'leaflet' loads the package 'sp' and this one requires the package 'rgdal'. Then is when I get disconnected from the server with the following logs:

2018-06-02T22:31:02.634150+00:00 shinyapps[353213]: Loading required package: sp
2018-06-02T22:31:05.044742+00:00 shinyapps[353213]: Warning: Error in .requireRgdal: package 'rgdal' is not available
2018-06-02T22:31:05.048443+00:00 shinyapps[353213]:     53: shapefile
2018-06-02T22:31:05.048439+00:00 shinyapps[353213]: Stack trace (innermost first):
2018-06-02T22:31:05.048443+00:00 shinyapps[353213]:     54: .local
2018-06-02T22:31:05.048441+00:00 shinyapps[353213]:     55: .requireRgdal
...
2018-06-02T22:31:05.048722+00:00 shinyapps[353213]: Error in .requireRgdal() : package 'rgdal' is not available

I have tryed puting an 'install.package('rdal') but the serves does no allow me to install packages.

So, what can we do when a package is not available?

Thank you all in advance.

ntde...@gmail.com

unread,
Jun 2, 2018, 10:30:15 PM6/2/18
to shinyapps.io Users
It seems you might be misspelling "rgdal". Try:
install.packages('rgdal')
If this doesn't work, you might have to upgrade your R version. I was hitting some issues last night where deploying required packrat, but I couldn't install because there wasn't a download for R version 3.4. Upgrading fixed this issue.

Jul R

unread,
Jun 3, 2018, 7:39:34 AM6/3/18
to shinyapps.io Users
Sorry, It misspelled while writing the post. We cannot install packages:

2018-06-03T11:33:28.837924+00:00 shinyapps[353213]: Warning in install.packages("rgdal") :
2018-06-03T11:33:28.837973+00:00 shinyapps[353213]:   'lib = "/opt/R/3.5.0/lib/R/library"' is not writable
2018-06-03T11:33:28.838896+00:00 shinyapps[353213]: Warning: Error in install.packages: unable to install packages
2018-06-03T11:33:28.850721+00:00 shinyapps[353213]:   63: stop
2018-06-03T11:33:28.850724+00:00 shinyapps[353213]:   62: install.packages
2018-06-03T11:33:28.850904+00:00 shinyapps[353213]: Error in install.packages("rgdal") : unable to install packages
 I have also upgraded my R version, but there is still the 'no available package' problem in shinyapps.io



Joshua Spiewak

unread,
Jun 4, 2018, 11:27:52 AM6/4/18
to shinyapps.io Users
You cannot include an install.packages statement in the code that you deploy, but if you install rgdal locally, and include library(rgdal) in the code you deploy, it will be installed for your application on shinyapps.io.

sp only suggests rgdal, so we don't know if you plan to use the features that trigger it being required or not.
Reply all
Reply to author
Forward
0 new messages