Skip to content

Instantly share code, notes, and snippets.

@dncgst
Last active February 8, 2024 13:45
Show Gist options
  • Save dncgst/111b74066eaea87c92cdc5211949cd1e to your computer and use it in GitHub Desktop.
Save dncgst/111b74066eaea87c92cdc5211949cd1e to your computer and use it in GitHub Desktop.
How to install the rgdal R package

How to install the rgdal R package

> install.packages("rgdal")

  • installing source package ‘rgdal’ ... configure: error: gdal-config not found or not executable.

The packages libgdal-dev and libproj-dev are required:

sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev

@hrlai
Copy link

hrlai commented Jun 15, 2021

Just bumping this in case @statgeek or anyone else managed to solve the problem when there's no sudo access?

Try this SO page https://askubuntu.com/questions/193695/installing-packages-into-local-directory it helped me.

@tomasiojanuario
Copy link

Many thanks. It worked
Muito obrigado pela dica

@YohansB
Copy link

YohansB commented Sep 1, 2021

Many thanks, that fixed it!

@DrDids
Copy link

DrDids commented Jan 4, 2022

Hi, I used

> install.packages("rgdal", repos="https://cloud.r-project.org/")

worked like a charm

Didier

P.S.
the normal install gave (I had also tried another CRAN repo):

in download.file(url, destfile, method, mode = "wb", ...) :
download from 'https://pbil.univ-lyon1.fr/CRAN/bin/macosx/contrib/4.1/rgdal_1.5-28.tgz' failed
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 19824640 != reported length 91041577
2: In download.file(url, destfile, method, mode = "wb", ...) :
URL 'https://pbil.univ-lyon1.fr/CRAN/bin/macosx/contrib/4.1/rgdal_1.5-28.tgz': Timeout of 60 seconds was reached
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘rgdal’ failed

@lucas-oliaro
Copy link

Thanks :)

@hyousefi89
Copy link

Hello
I couldn't install RGDAL. Please help.

install.packages("rgdal", type = "source")
Installing package into ‘C:/Users/Hossein/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rgdal’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

@tomasiojanuario
Copy link

tomasiojanuario commented Feb 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment