prec_cooccurrence: Compute a matrix of precinct co-occurrences

View source: R/tidy.R

prec_cooccurrenceR Documentation

Compute a matrix of precinct co-occurrences

Description

For a map with n precincts Returns an n-by-n matrix, where each entry measures the fraction of the plans in which the row and column precincts were in the same district.

Usage

prec_cooccurrence(plans, which = NULL, sampled_only = TRUE, ncores = 1)

Arguments

plans

a redist_plans object.

which

<data-masking> which plans to compute the co-occurrence over. Defaults to all.

sampled_only

if TRUE, do not include reference plans.

ncores

the number of parallel cores to use in the computation.

Value

a symmetric matrix the size of the number of precincts.


redist documentation built on April 3, 2023, 5:46 p.m.