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)

Arguments

from

smaller geography level

to

larger geography level

value

numeric vector of length nrow(from). Defaults to 1.

method

string from center, centroid, point, or area for matching levels

epsg

numeric EPSG code to planarize to. Default is 3857.

Value

numeric vector with each value aggregated by group

Examples

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