Join LGD boundary geometries to a data frame containing a state
(or district + state) column. Returns an sf object suitable for
mapping with ggplot2 or tmap.
Usage
attach_geometry(data, geography = NULL)
Arguments
- data
A data frame with a state column (and optionally district).
- geography
One of "state" or "district". If NULL, auto-detected
from column names.
Value
An sf object with geometry attached.
Examples
if (FALSE) { # \dontrun{
births <- get_hmis("live birth", sector = "Total", category = "Total")
births_sf <- attach_geometry(births)
plot(births_sf["value"])
} # }