R/competitiveness.R
compet_talisman.Rd
Compute Talismanic Redistricting Competitiveness Metric
compet_talisman(plans, shp, rvote, dvote, alpha = 1, beta = 1)
A redist_plans
object or plans_matrix where each row indicates a district assignment and each column is a plan.
A redist_map
object, tibble, or data frame containing other columns.
Unqouted name of column in shp
with group population.
Unqouted name of column in shp
with total population.
Numeric scaling value
Numeric scaling value
A numeric vector. Can be shaped into a district-by-plan matrix.
Wendy K. Tam Cho and Yan Y. Liu Toward a Talismanic Redistricting Tool. Election Law Journal. 15, 4. Pp. 351-366.
data(nh)
data(nh_m)
# For a single plan:
compet_talisman(plans = nh$r_2020, shp = nh, rvote = nrv, dvote = ndv)
#> [1] 0.04953732 0.04953732
# Or many plans:
compet_talisman(plans = nh_m[, 3:5], shp = nh, rvote = nrv, dvote = ndv)
#> [1] 0.02599922 0.02599922 0.02420340 0.02420340 0.02317628 0.02317628