Fortify函数甚至不使用'if(!require(gpclib))install.packages(“gpclib”,type =“source”)gpclibPermit()'

时间:2017-11-10 18:09:16

标签: r ggfortify

我正在尝试强化.shp文件,但是我收到以下错误:

  

错误:isTRUE(gpclibPermitStatus())不为TRUE

我尝试使用此代码修复它,正如其他问题所示:

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

但后来我收到以下错误(总结):

{{1}}

0 个答案:

没有答案