Simple method for aggregating data up to a higher level This is most often useful for getting population data from a block level up to a precinct level. Geographic partner to estimate_up.
geo_estimate_up(from, to, value, method = "center", epsg = 3857)
smaller geography level
larger geography level
numeric vector of length nrow(from). Defaults to 1.
string from center, centroid, point, or area for matching levels
numeric EPSG code to planarize to. Default is 3857.
numeric vector with each value aggregated by group
library(dplyr)
set.seed(1)
data(checkerboard)
counties <- checkerboard |>
group_by(id <= 32) |>
summarize(geometry = sf::st_union(geometry)) |>
mutate(pop = c(100, 200))
geo_estimate_up(from = checkerboard, to = counties, value = checkerboard$i)
#> Warning: Planarizing skipped. `x` missing CRS.
#> Warning: Planarizing skipped. `x` missing CRS.
#> [1] 176 48