classify_plans: Hierarchically classify a set of redistricting plans

View source: R/classify_compare.R

classify_plansR Documentation

Hierarchically classify a set of redistricting plans

Description

Applies hierarchical clustering to a distance matrix computed from a set of plans and takes the first k splits.

Usage

classify_plans(dist_mat, k = 8, method = "complete")

Arguments

dist_mat

a distance matrix, the output of plan_distances()

k

the number of groupings to create

method

the clustering method to use. See hclust() for options.

Value

An object of class redist_classified, which is a list with two elements:

groups

A character vector of group labels of the form "I.A.1.a.i", one for each plan.

splits

A list of splits in the hierarchical clustering. Each list element is a list of two mutually exclusive vectors of plan indices, labeled by their group classification, indicating the plans on each side of the split.

Use plot.redist_classified() for a visual summary.


redist documentation built on June 24, 2024, 9:10 a.m.