Title: How to turn gpclibPermit() to TRUE
Tags: r;maptools
Question: When I run gpclibPermit(), I've got the answer FALSE. How can I change it to be TRUE?
Comment: You need to have the `gpclib` package installed.

Here is the accepted answer: I've struggled with the gpclibPermit issue myself.  You don't provide a reproducible example, but I am guessing that you are having a sesion like this:
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()
&gt; gpclibPermitStatus()
[1] FALSE
&gt; gpclibPermit()
[1] FALSE
&gt; gpclibPermitStatus()
[1] FALSE
At this point it helps to look at what gpclibPermit and gpclibPermitStatus actually do:
&gt; 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&gt;
&gt; gpclibPermitStatus
function ()
get("gpclib", envir = .MAPTOOLS_CACHE)
<environment: namespace:maptools&gt;
That is, you can't give maptools the permission to use gpclib unless you have the package gpclib installed.
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()
&gt; gpclibPermit()
[1] TRUE
Warning message:
In gpclibPermit() :
support for gpclib will be withdrawn from maptools at the next major release
&gt; gpclibPermitStatus()
[1] TRUE

Here is another answer: I had this issue myself and found it easiest to install rgeos, and ensure that it was attached prior to attaching maptools
library(ggplot2)
library(rgeos)
library(maptools)
Comment for this answer: Nicely done solution resolves the gpclibPermit = FALSE message

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:01/13/14', 'FavoriteCount': 4.0, 'PostTypeId': 1, 'Tags': '<r><maptools>', 'Title': 'How to turn gpclibPermit() to TRUE', 'ViewCount': 18552, 'id': 21093399, 'user_AboutMe': '', 'user_AccountId': 2229535.0, 'user_DisplayName': 'PAC', 'user_Reputation': 5000.0, 'user_Views': 563.0, 'user_id': 1967500.0}}