Joins e-Stat boundary polygons onto a tidy get_estat() result by
area_code, returning an sf object ready for choropleth mapping. Each data
row receives its area's geometry (so a long time series repeats geometry per
period, matching the tidycensus long-plus-geometry convention).
Arguments
- data
A tibble from
get_estat()(decoded, with anarea_codecolumn).- level
Geographic level, or
"auto"(default) to infer:"prefecture"if everyarea_codeends in"000", otherwise"municipality".- year, datum, designated_cities
Passed to
estat_boundaries(). Matchyearto your data's census year.designated_citiesdefaults to"both"so data coded at either ward or parent-city level joins.
Value
An sf object: the input columns plus a geometry column.
Examples
if (FALSE) { # \dontrun{
d <- get_population_census(cdCat01 = "0")
sf_d <- estat_join_geometry(d, level = "prefecture", year = 2020)
} # }