Learn R Programming

redist (version 4.2.0)

redist.reorder: Reorders district numbers

Description

Ensures that for each column in the plans object, the first district listed is 1, the second is 2, up to n districts. Assumes that all columns have the same number of districts as the first.

Usage

redist.reorder(plans)

Value

integer matrix

Arguments

plans

A numeric vector (if only one map) or matrix with one row for each precinct and one column for each map.

Examples

Run this code
cds <- matrix(c(rep(c(4L, 5L, 2L, 1L, 3L), 5),
    rep(c(5L, 4L, 3L, 2L, 1L), 2), rep(c(4L, 5L, 2L, 1L, 3L), 3)), nrow = 25)
redist.reorder(cds)

Run the code above in your browser using DataLab