Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rgdal not available for R version 3.2.2

Tags:

r

rgdal

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.

like image 864
Shreta Ghimire Avatar asked Aug 21 '15 04:08

Shreta Ghimire


2 Answers

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
like image 141
Luís de Sousa Avatar answered Sep 18 '22 03:09

Luís de Sousa


to install rgdal upgrade your R version to at least 3.5.0

https://cran.r-project.org/package=rgdal

like image 30
ajay kumar mulakala Avatar answered Sep 19 '22 03:09

ajay kumar mulakala