I have a beginners question in R. I have a data frame (that contains data on some geographical regions) and I have a corresponding shapefile for those regions. I would like to plot the data from the data frame onto the geometry.
Looking at some examples in textbooks and online, e.g. in the sf package, it seems that the geometry data needs to be converted into multi-polygons rather than kept in the shapefile format.
My question is how does one convert a shapefile into the multi-polygon geometry data so that the data can be plotted? Does it need to be converted, and if not, is there another way?
I apologise for lack of code, but I don't quite know where to start.