label_party_margin {ggredist} | R Documentation |
Label Partisan Vote Shares
Description
For example, a 45% Democratic vote share becomes "R+10" or "55% R".
Usage
label_party_margin(midpoint = 0.5, reverse = FALSE, accuracy = 1)
label_party_pct(midpoint = 0.5, reverse = FALSE, accuracy = 1)
Arguments
midpoint |
Either 0.5, the default, or 0. For |
reverse |
If |
accuracy |
As with scales::number_format |
Value
A labeling function
Examples
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))
[Package ggredist version 0.0.2 Index]