comp_y_sym: Calculate Y Symmetry Compactness

View source: R/compactness.R

comp_y_symR Documentation

Calculate Y Symmetry Compactness

Description

Y symmetry is the overlapping area of a shape and its projection over the y-axis.

Usage

comp_y_sym(plans, shp, epsg = 3857, ncores = 1)

Arguments

plans

redist_plans object or plans_matrix where each row indicates a district assignment and each column is a plan

shp

redist_map object or tibble with sf geometry column

epsg

numeric EPSG code to planarize to. Default is 3857.

ncores

numeric. Number of cores to use. Default is 1.

Value

numeric vector

References

Aaron Kaufman, Gary King, and Mayya Komisarchik. 2021. How to Measure Legislative District Compactness If You Only Know it When You See It. American Journal of Political Science. 65, 3. Pp. 533-550.

Examples

#' data(nh)
data(nh_m)
# For a single plan:
comp_y_sym(plans = nh$r_2020, shp = nh)

# Or many plans:

# slower, beware!
comp_y_sym(plans = nh_m[, 3:5], shp = nh)



redistmetrics documentation built on April 11, 2022, 5:08 p.m.