usMap {mapStats} | R Documentation |
Shapefile of US state boundaries
Description
Examples are provided using the usMap
shapefile with a synthetic dataset.
Source
https://www.cdc.gov/brfss/gis/gis_maps.htm
Examples
#read the shapefile
#display first five rows of shapefile dataset
#plot the shapefile boundaries
usMap <- sf::as_Spatial(sf::st_read(system.file("shapes/usMap.shp", package="mapStats")[1]))
head(usMap@data)
# plot the outlines of the shapefile only
sp::plot(usMap)
# plot map colored according to one of the variables in @data
sp::spplot(usMap, zcol="A187_1")
[Package mapStats version 3.1 Index]