Learn R Programming

redist (version 2.0.2)

redist.distances: Compute Distance between Partitions

Description

Compute Distance between Partitions

Usage

redist.distances(district_membership, measure = "Hamming", ncores = 1)

Arguments

district_membership

A matrix with one row for each precinct and one column for each map. Required.

measure

String vector indicating which distances to compute. Implemented currently are "Hamming", "Manhattan", and "Euclidean". Use all to return all implemented measures.

ncores

Number of cores to use for parallel computing. Default is 1.

Value

list of matrices of distances with one for each distance measure selected

Examples

Run this code
# NOT RUN {
data("algdat.p10")
distances <- redist.distances(district_membership = algdat.p10$cdmat)
distances$Hamming[1:5,1:5]
# }

Run the code above in your browser using DataLab