当我运行gpclibPermit()
时,我得到了答案FALSE
。如何将其更改为TRUE
?
最佳答案
我自己一直在处理gpclibPermit
问题。您没有提供可复制的示例,但是我想您正在像这样进行讨论:
library(maptools)
Checking rgeos availability: FALSE
Note: when rgeos is not available, polygon geometry computations in maptools depend
on gpclib, which has a restricted licence. It is disabled by default;
to enable gpclib, type gpclibPermit()
> gpclibPermitStatus()
[1] FALSE
> gpclibPermit()
[1] FALSE
> gpclibPermitStatus()
[1] FALSE
在这一点上,有助于查看
gpclibPermit
和gpclibPermitStatus
的实际作用:> gpclibPermit
function ()
{
if ("gpclib" %in% .packages(all.available = TRUE))
assign("gpclib", TRUE, envir = .MAPTOOLS_CACHE)
if (gpclibPermitStatus())
warning("support for gpclib will be withdrawn from maptools at the next major release")
gpclibPermitStatus()
}
<environment: namespace:maptools>
> gpclibPermitStatus
function ()
get("gpclib", envir = .MAPTOOLS_CACHE)
<environment: namespace:maptools>
也就是说,除非您安装了
maptools
软件包,否则您不能授予gpclib
使用gpclib
的权限。install.packages("gpclib")
library(maptools)
Loading required package: sp
Checking rgeos availability: FALSE
Note: when rgeos is not available, polygon geometry computations in maptools depend on gpclib, which has a restricted licence. It is disabled by default; to enable gpclib, type gpclibPermit()
> gpclibPermit()
[1] TRUE
Warning message:
In gpclibPermit() :
support for gpclib will be withdrawn from maptools at the next major release
> gpclibPermitStatus()
[1] TRUE