Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rgeos package installation error on linux [R]

Tags:

linux

r

rgdal

I'm trying to install the package rgeos on linux. I get the following error:

system("sudo apt-get update")
system("sudo apt install libgdal-dev -y")
install.packages("rgeos")
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: initGEOS_r not found in libgeos_c.
ERROR: configuration failed for package ‘rgeos’

I have already install the dev libgdal and it returns the "already installed" info if I try to run the sudo again.

How can I fix this? Thanks in advance!

like image 861
Neal Barsch Avatar asked Oct 22 '18 03:10

Neal Barsch


1 Answers

It is a bug, you could use this to install lower stable version.

install.packages("devtools")
library(devtools)
install_version("rgeos", version = "0.3-28")

After this code all should be fine.

like image 190
mark Avatar answered Sep 18 '22 08:09

mark