redist.plot.hist: Plot a histogram of a summary statistic

View source: R/plot_plans.R

redist.plot.histR Documentation

Plot a histogram of a summary statistic

Description

Plots a histogram of a statistic of a redist_plans object, with a reference line for each reference plan, if applicable.

Usage

redist.plot.hist(plans, qty, bins = NULL, ...)

## S3 method for class 'redist_plans'
hist(x, qty, ...)

Arguments

plans

the redist_plans object.

qty

<data-masking> the statistic.

bins

the number of bins to use in the histogram. Defaults to Freedman-Diaconis rule.

...

passed on to geom_histogram

x

<data-masking> the statistic.

Value

A ggplot

Examples

library(dplyr)
data(iowa)

iowa <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.05)
plans <- redist_smc(iowa, nsims = 100, silent = TRUE)
group_by(plans, draw) %>%
    summarize(pop_dev = max(abs(total_pop/mean(total_pop) - 1))) %>%
    redist.plot.hist(pop_dev)


redist documentation built on June 24, 2024, 9:10 a.m.