geo_estimate_up | R Documentation |
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)
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.