I loaded a shapefile in R using readOGR and I named as
I can see the shape pretty well by using
The issue is that polygons' id (the id of the plot) is not the same with the @data id. What I mean is that, when I run:
plot(data.map[2, ]) data.map@data[2, ]
the polygon 2 that is drawed in the plot, is not the one that the data row 2 refers to.