Learn R Programming

redist (version 4.2.0)

redist.prep.enumpart: Prepares a run of the enumpart algorithm by ordering edges

Description

Prepares a run of the enumpart algorithm by ordering edges

Usage

redist.prep.enumpart(
  adj,
  unordered_path,
  ordered_path,
  weight_path = NULL,
  total_pop = NULL
)

Value

0 on success

Arguments

adj

zero indexed adjacency list

unordered_path

valid path to output the unordered adjacency map to

ordered_path

valid path to output the ordered adjacency map to

weight_path

A path (not including ".dat") to store a space-delimited file containing a vector of vertex weights. Only supply with total_pop.

total_pop

the vector of precinct populations. Only supply with weight_path

References

Benjamin Fifield, Kosuke Imai, Jun Kawahara, and Christopher T Kenny. "The Essential Role of Empirical Validation in Legislative Redistricting Simulation." Forthcoming, Statistics and Public Policy.

Examples

Run this code
if (FALSE) {
temp <- tempdir()
data(fl25)
adj <- redist.adjacency(fl25)
redist.prep.enumpart(adj = adj, unordered_path = paste0(temp, "/unordered"),
    ordered_path = paste0(temp, "/ordered"))
}

Run the code above in your browser using DataLab