Learn R Programming

eiExpand (version 1.0.5)

rpv_coef_plot: Racially Polarized Voting Analysis (RPV) Coefficient Plot

Description

Creates a coefficient plot showing of RPV results estimate ranges of all contests by voter race

Usage

rpv_coef_plot(
  rpvDF = NULL,
  title = "Racially Polarized Voting Analysis Estimates",
  caption = "Data: eiCompare RPV estimates",
  ylab = NULL,
  colors = NULL,
  race_order = NULL
)

Value

Coefficient plot of RPV analysis as a ggplot2 object

Arguments

rpvDF

A data.frame containing RPV results

title

The plot title

caption

The plot caption

ylab

Label along y axis

colors

Character vector of colors, one for each racial group. The order of colors will be respective to the order of racial groups.

race_order

Character vector of racial groups from the voter_race column of rpvDF in the order they should appear in the plot. If not specified, the race groups will appear in alphabetical order.

Author

Rachel Carroll <rachelcarroll4@gmail.com>

Stephen El-Khatib <stevekhatib@gmail.com>

Loren Collingwood <lcollingwood@unm.edu>

Examples

Run this code
library(eiExpand)
data(example_rpvDF)

dem_rpv_results <- example_rpvDF %>% dplyr::filter(Party == "Democratic")
rpv_coef_plot(dem_rpv_results)

Run the code above in your browser using DataLab