dist_ham: Calculate Hamming Distances

Description Usage Arguments Value Examples

View source: R/distances.R

Description

Calculate Hamming Distances

Usage

1
dist_ham(plans, ncores = 1)

Arguments

plans

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

ncores

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

Value

matrix of plan distances

Examples

1
2
3
4
5
6
7
data(nh)
data(nh_m)
# For a single plan (distance is trivial, 0):
dist_ham(plans = nh$r_2020)

# Or many plans:
dist_ham(plans = nh_m[, 3:5])

redistmetrics documentation built on Dec. 20, 2021, 5:07 p.m.