Learn R Programming

eiCompare (version 3.0.4)

race_check_2_3: race_check_2_3

Description

Checks that both sides of the RxC equation for White/Minority and White, Black, Hispanic, Other, respectively, add up to the same values. If small rounding issues, adjusts the "other" race category.

Usage

race_check_2_3(
  dat,
  split = c(3, 4),
  catch = FALSE,
  catch_col = NULL,
  print_sides = TRUE
)

Value

Dataset of Left side (Votes) vs. Right side (Demographics). diff column can be tagged on to exiting 'other' category to expedite data preparation process.

Arguments

dat

data.frame() object. One no vote/third party vote column, with candidate votes (for either 2 or 3 candidates), then up to four demographics with last as other

split

Numeric vector of length 2. Default is c(3,4), for two candidates and one catch-all. c(4,5) for three candidates and one catch all.

catch

Logical (TRUE/FALSE). Catch negative values. Default is FALSE

catch_col

Column names to be catched.

print_sides

Logical (TRUE/FALSE). Print out evaluations. Default is TRUE

Author

Loren Collingwood <loren.collingwood@ucr.edu>

Examples

Run this code

  
  # EXAMPLE: NOT RUN #
  

Run the code above in your browser using DataLab