Unable to install ‘sf’ R package on Ubuntu 16.04 L

2019-08-26 01:20发布

问题:

I'm not able to install sf R package on Ubuntu 16.04 LTS. I tried

install.packages("sf")

as well as

devtools::install_github("r-spatial/sf")

after running

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev 

Getting the following error message:

configure: error: gdal-config not found or not executable.

ERROR: configuration failed for package ‘sf’

Wonder what is the way to install sf?

回答1:

This worked for me. Using

sudo aptitude install libgdal-dev

and then

devtools::install_github("r-spatial/sf")