filter_existing: Filter down a long dataset to precinct-ballot style...

View source: R/nocontest_vs_abstain.R

filter_existingR Documentation

Filter down a long dataset to precinct-ballot style combinations for which that contest race exists. Otherwise, observation is dropped

Description

Filter down a long dataset to precinct-ballot style combinations for which that contest race exists. Otherwise, observation is dropped

Usage

filter_existing(tbl, pattern, race, na_thresh = 0.8, gtbl = NULL)

Arguments

tbl

dataset

pattern

regex to identify the race. Must resolve to one variable

race

tabulation of votes

na_thresh

how much NAs can is still a abstention?

gtbl

join with a table with more district information like county.


kuriwaki/ballot documentation built on May 1, 2023, 9:55 p.m.