Pick One Plan from Many Plans

pick_a_plan(
plans,
map,
counties = NULL,
comp = NULL,
maximize_comp = TRUE,
cut_point = 0.3
)

## Arguments

plans

a redist_plans object

map

a redist_map object

counties

A column in map with county names. Defaults to NULL and will assume each row in map is its own county if left NULL

comp

A column in plans with compactness. Defaults to NULL and will calculate FracKept if left NULL

maximize_comp

Should comp be maximized? Defaults to TRUE.

cut_point

portion of plans to keep at each step

## Value

An integer vector with a single plan

## Examples

data(iowa)
map <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.01, total_pop = pop)
sims <- redist_smc(map, 100)
#> SEQUENTIAL MONTE CARLO
#> Sampling 100 99-unit maps with 4 districts and population between 753,973 and 769,205.
#> Split [0/3] ■                                | ETA?
#> Split [3/3] ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  | ETA 0s
#>
pick_a_plan(sims, map)
#> An earlier bug incorrectly in redist doubled the number of removed edges.
#> Current counts are correct.
#> This message is displayed once per session.
#>  [1] 3 3 2 4 3 4 4 1 2 2 3 1 3 3 3 2 1 3 1 3 3 2 2 3 1 4 3 2 4 3 2 3 2 1 1 3 1 4
#> [39] 3 1 1 1 3 4 1 1 3 4 2 4 4 4 2 4 3 4 2 4 3 3 3 4 3 4 3 1 3 3 3 2 3 3 3 3 3 3
#> [77] 1 3 4 3 3 2 3 3 4 4 3 3 4 4 3 4 3 1 3 2 3 1 1