add_precinct: Add precinct to each row of vote dataset, and remove other...

View source: R/read_SC.R

add_precinctR Documentation

Add precinct to each row of vote dataset, and remove other headers

Description

Use the non-equi join in data.table to identify precinct. row i is in precinct j if i's ID is in between p_start_id and p_end_id of precint j.

Usage

add_precinct(votes, pkey)

Arguments

votes

EL155 dataset of votes, product of read_EL155()

pkey

precinct key, product of get_precinct_range()

Examples

data(G2016_Dillon_EL155)
dillon_p <- get_precinct(G2016_Dillon_EL155)
wprecinct <- add_precinct(G2016_Dillon_EL155, dillon_p)


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