Learn R Programming

redist (version 3.1.5)

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)

Arguments

plans

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

Value

integer matrix

Examples

Run this code
# NOT RUN {
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