Interactive Plan Drawing
Usage
draw(
shp,
init_plan,
ndists,
palette = NULL,
layers = NULL,
pop_tol = 0.05,
pop_col = "pop",
adj_col = "adj",
split_cols = guess_admins,
elect_cols = guess_elections,
demog_cols = guesstimate_demographics,
hover_fn = hover_precinct,
opts = redistio_options()
)Arguments
- shp
an
sftibble that you want to draw with- init_plan
Plan to initialize with.
- ndists
Number of districts to draw if
init_planis not supplied.- palette
Color palette to fill shapes with. Default is
Polychrome 36or, if installed,crayons::crayons$no_48.- layers
Named list of
sfobjects to overlay. Also takes column names inshpto group by.- pop_tol
the population tolerance.
- pop_col
Name of column in
shpthat contains population data.- adj_col
Name of column in
shpthat contains adjacency information.- split_cols
Names of column in
shpthat contain administrative units- elect_cols
Names of column in
shpthat contain election data- demog_cols
Names of column in
shpthat contain demographic data- hover_fn
Function to generate tables for mouse hovering. Default is
hover_precinct().- opts
list of options. Default is
redistio_options()
Examples
if (interactive()) {
draw(dc, dc$ward)
draw(dc, dc$ward, layers = list(neighborhoods = 'adv_nbr'))
}
