add_lead | R Documentation |
We often want to know how much further one party is ahead of another in the polls. But this can be tricky when the polls contain error. This function takes a dataset with columns named "party_est" and "party_err", computes the lead of one party over another, and appends it plus the error in the estimate to the data.
add_lead(data = NULL, party1 = "con", party2 = "lab", name = "lead")
data |
A dataset containing variables called party_est and party_err |
party1 |
The name of party |
party2 |
The name of your date variable in your data. |
name |
The name . Defaults to "lead". |
A tibble of data.
add_lead(data = pollbasepro, party1 = "con", party2 = "lab")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.