How can I keep polygons\'s information after shapefile? Let me try to explain:
I have a shapefile with this data:
> head(mapa@data) ID C
Maybe this is a slightly simpler solution
library(dplyr) library(ggplot2) # fortify the shape file map.df <- fortify(shape, region ="CD_GEOCODI") # merge data map.df <- left_join(map.df, data, by=c('id'='CD_GEOCODI'))