Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RGDAL won't install

I can't get RGDAL to install in R. I'm using Ubuntu 12.04.

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

I found some solutions which said to do this:

sudo apt-get install aptitude
sudo aptitude install libgdal-dev 
sudo aptitude install libproj-dev

I follow these through, accepting 'yes' when prompted, but afterwards the same original error. It doesn't resolve it. I wonder whether I should be downgrading something perhaps?

Thanks, James.

like image 637
TheRealJimShady Avatar asked Jul 10 '15 13:07

TheRealJimShady


People also ask

What is the Rgdal package in R?

Provides bindings to the 'Geospatial' Data Abstraction Library ('GDAL') (>= 1.11. 4) and access to projection/transformation operations from the 'PROJ' library.


1 Answers

First check that everything is up to date with:

sudo apt-get update

On a slight tangent - i usually also install and a few others (needed for libraries like tidyverse):

sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev

Then install Rgdal and proj.4 (you may have to click yes a few times):

sudo apt-get install libgdal-dev 
sudo apt-get install libproj-dev
like image 171
Andy Barker Avatar answered Oct 18 '22 06:10

Andy Barker