Learn R Programming

redist (version 4.2.0)

number_by: Renumber districts to match a quantity of interest

Description

District numbers in simulated plans are by and large random. This function will renumber the districts across all simulated plans in order of a provided quantity of interest.

Usage

number_by(data, x, desc = FALSE)

Value

a modified redist_plans object. New district numbers will be stored as an ordered factor variable in the district column. The district numbers in the plan matrix will match the levels of this factor.

Arguments

data

a redist_plans object

x

<data-masking> the quantity of interest.

desc

TRUE if district should be sorted in descending order.