geo_estimate_up: Estimate Up Geography Levels

View source: R/estimate.R

geo_estimate_upR Documentation

Estimate Up Geography Levels

Description

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.

Usage

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)

geomander documentation built on April 16, 2023, 5:18 p.m.