Calculate Euclidean Distances
dist_euc(plans, ncores = 1)
Arguments
- plans
A redist_plans
object or plans_matrix where each row indicates a district assignment and each column is a plan.
- ncores
Integer number of cores to use. Default is 1.
Value
matrix of plan distances
Examples
data(nh)
data(nh_m)
# For a single plan (distance is trivial, 0):
dist_euc(plans = nh$r_2020)
#> [1] 0
# Or many plans:
dist_euc(plans = nh_m[, 3:5])
#> [,1] [,2] [,3]
#> [1,] 0.00000 15.264338 16.492423
#> [2,] 15.26434 0.000000 9.949874
#> [3,] 16.49242 9.949874 0.000000