This question already has an answer here:
I am learning and I made a very similar question when I hadn't learnt what a Spatial Polygons Data Frame was about 10 days ago: https://stackoverflow.com/questions/49193867/select-raster-in-ggplot-near-coastline.
Now, I have discovered the magic of SPDF and choropleth maps and have in essence the same question but with different types of files. I am still wrapping my head around S4 objects and I can't figure out how to subset certain mini-polygons
MUNICIPI from my data set.
To the point!
I would like to subset all
MUNICIPI that are within a certain distance from the coast, clear data for the rest of the
MUNICIPI and just work with the my new subset yet plotting the entire geometry.
A choropleth map of what I want looks like this.
Let's say 20km as @urbandatascientist set in his answer to my first question and create a choropleth map of, for example,
upper_trees with the subsetted
From the https://stackoverflow.com/questions/49193867/select-raster-in-ggplot-near-coastline post I also have the
list.of.polygon.boundaries that we'll substract
MUNICIPI coordinates from.
Once I subset the coastal
MUNICIPI, I'm hoping the map will look something like the green shaded region here. I have also tried to make sure that coordinates are in the same between
So far, here's my chloropleth map for the entire region using
upper_trees as an example: