Up to this point, we have dealt with data that fits into the tidy format without much effort. Spatial data has many complicating factors that have made handling spatial data in R complicated. Big strides are being made to make spatial data tidy in R. However; we are in the middle of the transition.
We will use
library(sf) to make a map of the US and show the top 3 largest cities in each state. Specifically, you will use
library(ggplot2) and the function
geom_sf() to recreate the provided image.
This reading will help you complete the tasks below.
.pngimage that closely matches my example
fill = NAin
geom_sf()will not fill the polygons with a grey color
library(USAboundaries)has three useful functions -
.pngfiles to GitHub