Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: isTRUE(gpclibPermitStatus()) is not TRUE when using fortify function, rgdal package

Tags:

r

rgdal

I am trying to work with spatial data that I downloaded here in order to make a map in ggplot2.

library(rgdal)
library(ggplot2)
library(rgeos)
df <- readOGR(mydirectory, layer = 'gem_2013_v1')
df.fort <- fortify(df, region = "AANT_INW")

I keep on getting this error when using the function fortify:

Error: isTRUE(gpclibPermitStatus()) is not TRUE

Has anyone an idea about what's going wrong here? Most appreciated!

EDIT:

As mentioned in the comments a possible duplicate of this question can be found here. It is stated that the solution of the problem can be found in installing package gpclib. I am not sure if that's the case, this package has been removed from CRAN.

like image 891
rdatasculptor Avatar asked Nov 29 '14 14:11

rdatasculptor


2 Answers

I had this issue after upgrading R. I reinstalled rgdal and all was good.

like image 149
Erik Westlund Avatar answered Nov 15 '22 09:11

Erik Westlund


I had the same problem, I had to install gpclib. I'm not sure if when you made the update it was removed from CRAN, but it's there now. It must be installed from source so you'll have to use the following code:

install.packages("gpclib", type = "source")

Note that to install with this code you'll need to have the appropriate version of Rtools installed.

like image 38
cmishra Avatar answered Nov 15 '22 09:11

cmishra