View source: R/join_to_party.R
join_dist | R Documentation |
Calls join_1col internally
join_dist(tbl, cands, office)
join_county(tbl, cands, office)
join_countydist(tbl, cands, office)
tbl |
variables must be of the type 'office_vote', 'office_dist' (if dist) and county for vote name and district, respectively. |
cands |
A table of candidates. Must have variables |
office |
NSE short form of the office in question |
Use join_dist
for an office based on a single district number (like USHOU
or state house, use join_county
for an office countywide (like Sheriff),
join_countydist
for an office based on both (like county council). All are
wrappers to join_1col
. We simplify the problem into just a one-variable
merge.
It creates new columns for each contest
: contest_party
, a numeric
-1 (D), 0 (Abstain / 3rd Party / Write-in), 1 (R), and contest_dist
, a
number for the district of the voter of the contest in question if applicable, and
contest_ncand
, the number of D-Rs in the district (does not count 3rd party)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.