plot_bivariate: Plot bivariate relationships between all combinations of...

View source: R/ei_descriptives.R

plot_bivariateR Documentation

Plot bivariate relationships between all combinations of candidates and race/ethnicities

Description

Plot bivariate relationships between all combinations of candidates and race/ethnicities

Usage

plot_bivariate(
  data,
  cand_cols,
  race_cols,
  corrs = FALSE,
  save = FALSE,
  path = NULL
)

Arguments

data

A data.frame() object containing precinct-level turnout data by race and candidate

cand_cols

A character vector listing the column names for turnout for each candidate

race_cols

A character vector listing the column names for turnout by race

corrs

A boolean indicating whether to include correlation coefficients on the plot.

save

A boolean indicating whether to save the plot to a file.

path

A string to specify plot save location. If NULL, plot is not saved.

Value

ggplot object with bivariate plots faceted by candidate and race


eiCompare documentation built on Aug. 31, 2023, 5:16 p.m.