In my book on modern data analyisis using R, I show some basics of geoplotting. It seems that some software update for the package simple features broke my code. So, here ’s some update. Load packages and data library(tidyverse) library(viridis) library(sf) data(socec, package = "pradadata") data(wahlkreise_shp, package = "pradadata") Check data glimpse(socec) #> Observations: 316 #> Variables: 51 #> $ V01 <chr> "Schleswig-Holstein", "Schleswig-Holstein", "Schleswig-Holst… #> $ V02 <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …