7.1 Geographic data: Vector boundaries & Area metadata
- Vector boundaries (polygons)
- Data frame with one row for each ‘corner’ of a geographical region
lat
andlong
: location of a pointgroup
: a unique identifier for each contiguous regionid
: the name of the region- Separate
group
andid
are necessary because geo-graphical unit isn’t necessarily a polygon (e.g., islands of Hawaii)
- Shape files contain vector boundary data (read them with e.g.,
readOGR()
) geom_polygon()
: Visualize the data (coordquickmap()
for quick adjustment of aspect ratio)
- Data frame with one row for each ‘corner’ of a geographical region
- Area metadata
- Sometimes metadata is associated with an area (rather than a point), e.g., census data on the county level
- We’ll see an example further below