parse_EL155 | R Documentation |
Use fwf to separate out colums in vote rows. Entries need to be votes, thus
they need to be a product of get_precinct_range()
Data looks like
5123906 2 * 10 Nikki R Haley GOVERNOR
parse_EL155(
votes,
vote_col = "text",
start_pos = c(1, 9, 14, 16, 21, 61),
end_pos = c(7, 12, 14, 19, 59, 131),
col_names = c("machine", "ballot_style", "marker", "choice_id", "choice_name",
"contest_name")
)
votes |
data frame with row |
vote_col |
column name (in characters) where the votes are |
start_pos |
numerical vector of start char positions |
end_pos |
numerical vector of end char positions |
col_names |
names of variables for each column |
data(G2016_Dillon_EL155)
dillon_p <- get_precinct(G2016_Dillon_EL155)
wprecinct <- add_precinct(G2016_Dillon_EL155, dillon_p)
df <- parse_EL155(wprecinct)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.