r - 错误:isTRUE(gpclibPermitStatus())不是TRUE

标签 r gis choropleth

这个问题可能是an earlier unanswered one的副本。我仍然有问题。

我正在尝试使用邮政编码shapefile并出现以下错误:

tract <- readOGR(dsn = ".", layer = "cb_2013_us_zcta510_500k")
tract<-fortify(tract, region="GEOID10")
Error: isTRUE(gpclibPermitStatus()) is not TRUE

我尝试安装gpclib来解决此问题,但随后出现以下错误:
install.packages("gpclib")

Installing package into ‘C:/Users/Nick/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘gpclib’
  These will not be installed

救命?

最佳答案

您可以查看ggplot2 / R / fortify-spatial.r的Hadley的master文件。根据this外部链接,我的理解是第31–34行(当前形式)用于读取类似

# Union together all polygons that make up a region
try_require(c("gpclib", "maptools"))
unioned <- unionSpatialPolygons(cp, invert(polys))

因此,当时解决问题的一种方法是打开许可证
library(rgdal)
library(maptools)
if (!require(gpclib)) install.packages("gpclib", type="source")
gpclibPermit()

就像@ rcs,@ Edzer Pebesma和此answer一样,rgeos应该可以解决最新安装的问题。

关于r - 错误:isTRUE(gpclibPermitStatus())不是TRUE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30790036/

相关文章:

r - 本地 block 纵横比为 1 时,将地 block 与拼凑而成

algorithm - 如何将必应 map 四键转换为墨卡托坐标

python - 发生异常 : SSLError when adding basemap with Contextily to GeoPandas map

python - Beautiful Soup - `findAll` 没有捕获 SVG (`ElementTree` 中的所有标签)

python - 向 Choropleth map 添加下拉菜单以选择每个州并生成新的图形类型

python-3.x - 更改在 plotly 中悬停在 Choropleth map 上时出现的内容的属性

r - ~ 的总和是什么意思?

R ggplot2 : How can I name the y axis depending on the value of a variable with facet_wrap?

r - 子集有序组件和相对变量名称

javascript - 从 OpenLayers3 中的图层组获取图层名称属性