I'm trying to install a few packages, but getting errors because dependencies are not installed for some of them.
I'm doing:
x <- c("ggmap", "rgdal", "rgeos", "maptools", "dplyr", "tidyr", "tmap")
# install.packages(x) # warning: uncommenting this may take a number of minutes
lapply(x, install.packages) # install packages
But I'm getting:
* DONE (leaflet)
ERROR: dependencies ‘geojsonio’, ‘geojsonlint’, ‘sf’, ‘V8’ are not available for package ‘rmapshaper’
* removing ‘/home/ogonzales/R/x86_64-pc-linux-gnu-library/3.4/rmapshaper’
Warning in install.packages :
installation of package ‘rmapshaper’ had non-zero exit status
ERROR: dependencies ‘gdalUtils’, ‘sf’, ‘svglite’ are not available for package ‘mapview’
* removing ‘/home/ogonzales/R/x86_64-pc-linux-gnu-library/3.4/mapview’
Is there a way to capture this "not present" dependencies in order to install them and then restart the installation of the first packages?
I would prefer not to install these dependencies 1 by 1, and then proceed with the packages I'm really interested in.
Thank you.