我正在尝试强化 .shp 文件,但出现以下错误:
错误:isTRUE(gpclibPermitStatus()) 不是 TRUE
正如其他问题中所建议的那样,我尝试使用此代码来修复它:
install.packages("gpclib", type="source")
require(gpclib)
if(!require(gpclib)) install.packages("gpclib", type = "source")
gpclibPermit()
尽管如此,错误再次发生。这是完整的代码:
library(broom)
library(maptools)
library(stringr)
library(ggplot2)
library(readr)
library(dplyr, warn.conflicts = F)
library(ggmap)
library(maps)
library(mapdata)
library(rgeos)
library(sp)
library(rgdal)
install.packages("gpclib", type="source")
require(gpclib)
if(!require(gpclib)) install.packages("gpclib", type = "source")
gpclibPermit()
shape1<-readShapeSpatial("/Users/marco/Documents/neweuropemap.shp")
shape1@data$id<-rownames(shape1@data)
shape.fort <- fortify(shape1, region = "id")
但后来我得到以下错误(总结):
Installing package into �/R/win-library/3.4�
trying URL 'https://cran.rstudio.com/src/contrib/gpclib_1.5-5.tar.gz'
* installing *source* package 'gpclib' ...
** package 'gpclib' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-34~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk" SHLIB="gpclib.dll" OBJECTS="Rgpc.o gpc.o"' had status 127
ERROR: compilation failed for package 'gpclib'
Warning in install.packages :
installation of package ‘gpclib’ had non-zero exit status
Loading required package: gpclib
Failed with error: ‘‘gpclib’ is not a valid installed package’
trying URL 'https://cran.rstudio.com/src/contrib/gpclib_1.5-5.tar.gz'
* installing *source* package 'gpclib' ...
** package 'gpclib' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/Makeconf" -f "C:/winshlib.mk" SHLIB="gpclib.dll" OBJECTS="Rgpc.o gpc.o"' had status 127
ERROR: compilation failed for package 'gpclib'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l
Warning in install.packages :
installation of package ‘gpclib’ had non-zero exit status
The downloaded source packages are in
‘C:\RtmpAZqVc8\downloaded_packages’
[1] FALSE
use rgdal::readOGR or sf::st_readuse rgdal::readOGR or sf::st_read
Show Traceback
Error: isTRUE(gpclibPermitStatus()) is not TRUE