Reputation: 1029
I am trying out the examples mentioned in this link . I have successfully installed all the packages mentioned as the basic packages here.
When I try to use command gmap
(given in the example as mymap <- gmap("France")
i get the following problem:
> gmap("France")
Loading required namespace: rgdal
Failed with error: ‘there is no package called ‘rgdal’’
Error in gmap("France") : rgdal not available
Also I am aware that gmap
command belongs to the package dismo
. And I have successfully installed this package.
Upvotes: 7
Views: 14203
Reputation: 11
to install rgdal upgrade your R version to at least 3.5.0
https://cran.r-project.org/package=rgdal
Upvotes: 1
Reputation: 6841
One of the reasons for this error is an outdated version of the core R package. On Ubuntu, for instance, this happens if the r-base
package is installed from the universe repository.
The fix is to add the CRAN repository and install R from there:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
Upvotes: 0
Reputation: 1126
I had the same trouble and was getting an error 'rgdal' was built under R version 3.1.3.
when I was trying install.packages("rgdal")
, and installation of package had non-zero exit status
when trying install.packages('rgdal', type = "source")
But it worked just now, try again.
Upvotes: 0