label_party_margin | R Documentation |
For example, a 45% Democratic vote share becomes "R+10" or "55% R".
label_party_margin(midpoint = 0.5, reverse = FALSE, accuracy = 1)
label_party_pct(midpoint = 0.5, reverse = FALSE, accuracy = 1)
midpoint |
Either 0.5, the default, or 0. For |
reverse |
If |
accuracy |
As with scales::number_format |
A labeling function
labeler = label_party_margin(accuracy=0.1)
labeler(c(0.3, 0.5, 0.543))
labeler = label_party_margin(reverse=TRUE)
labeler(c(0.3, 0.5, 0.543))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.