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

£可爱£侵袭症+ 提交于 2019-12-01 18:09:55

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/27203231/error-istruegpclibpermitstatus-is-not-true-when-using-fortify-function-rgd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!