<div dir="ltr"><div><div>Hi;<br></div>I am working with<a href="https://www.dropbox.com/s/dr8acy287brfk5r/900VCWTKZU.zip?dl=0" target="_blank"> this shapefile</a> (voting districts in Madrid, Spain) in R. I have got an error (see below, please) and went to QGIS trying to fix it.  I've gone to QGIS and checked the validity of geometry and founf the 
defective polygon, but I can not fix the problem (I can not delete the polygon, even if I would prefer not to 
delete it). Can anybody help me?<br></div>Thanks!<br><div><br><br>After running the following code <br><p style="margin-left:20px">library(rgdal)<br>
library(rgeos)<br>
cam = readOGR(dsn=".", layer="200001490")</p><p style="margin-left:20px">library(gpclib)<br>
library(maptools)<br>
library(ggplot2)<br>
library(dplyr)</p>
<p style="margin-left:20px">gpclibPermit()</p>
<p style="margin-left:20px">cam@data$id = rownames(cam@data)<br>
cam.points = fortify(cam, region="id")</p>
<p>I've got the following error</p>
<p style="margin-left:20px"><br>
Error: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4</p>
<br><br></div></div>