Do you know of ggplot2::geom_sf(); it handles "sf" objects natively? Using tidy etc. mangles the spatial objects, missing holes in polygons, so please do not promote it; not fit for purpose (Hadley Wickham's useR! plenary talk in 2016).
The colour reversal is all down to ggplot, which reads palettes the other way from everything else (you'd need a direction argument to sort out a twitter comment).
Also note that this ESRI-source file is UTM zone 30 (projected), but the only Municipios_IGN file I saw was in geographical coordinates - you did not show how to project/transform the object.
And yes, most things can be done without tidyverse, unless it is essential.
A couple of comments. Do you know Displaying Time Series, Spatial, and Space-Time Data with R by Oscar Perpiñán Lamigueiro (https://www.crcpress.com/Displaying-Time-Series-Spatial-and-Space-Time-Data-with-R/Perpinan-Lamigueiro/p/book/9781138089983)? Might it have helped?
Do you know of
ggplot2::geom_sf()
; it handles"sf"
objects natively? Using tidy etc. mangles the spatial objects, missing holes in polygons, so please do not promote it; not fit for purpose (Hadley Wickham's useR! plenary talk in 2016).The colour reversal is all down to ggplot, which reads palettes the other way from everything else (you'd need a direction argument to sort out a twitter comment).
classInt provides all you need to choose thematic mapping class intervals, including user-defined fixed breaks. It is used internally by sf, tmap and cartography. Using tmap, your maps are close to one-liners; inset maps are presented in Lovelace et al. (2019) ch. 8 (https://www.crcpress.com/Geocomputation-with-R/Lovelace-Nowosad-Muenchow/p/book/9781138304512), also(https://geocompr.robinlovelace.net/). @robinlovelace, @Nowosad - could you advise - original reference here https://twitter.com/ariamsita/status/1188548779772907526? I couldn't find your data, so chose Renta media por persona.
Renta media por persona.zip - my CSV data file. Shapefile from https://www.arcgis.com/home/item.html?id=5f689357238847bc823a2fb164544a77 as in the main document.
Also note that this ESRI-source file is UTM zone 30 (projected), but the only Municipios_IGN file I saw was in geographical coordinates - you did not show how to project/transform the object.
And yes, most things can be done without tidyverse, unless it is essential.