Learn R Programming

geomander (version 2.3.0)

geo_estimate_down: Estimate Down Geography Levels

Description

Simple method for estimating data down to a lower level. This is most often useful for getting election data down from a precinct level to a block level in the case that a state or other jurisdiction split precincts when creating districts. Geographic partner to estimate_down.

Usage

geo_estimate_down(from, to, wts, value, method = "center", epsg = 3857)

Value

numeric vector with each value split by weight

Arguments

from

Larger geography level

to

smaller geography level

wts

numeric vector of length nrow(to). Defaults to 1. Typically population or VAP, as a weight to give each precinct.

value

numeric vector of length nrow(from). Defaults to 1. Typically electoral outcomes, as a value to estimate down into blocks.

method

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

epsg

numeric EPSG code to planarize to. Default is 3857.

Examples

Run this code
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_down(from = counties, to = checkerboard, value = counties$pop)

Run the code above in your browser using DataLab