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.
I had this issue after upgrading R. I reinstalled rgdal
and all was good.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With