powered by
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)
label_party_pct(midpoint = 0.5, reverse = FALSE, accuracy = 1)
A labeling function
Either 0.5, the default, or 0. For label_party_margin(), if zero, scale will not be doubled (0.05 becomes "D+5" with midpoint=0, while 0.55 becomes "D+10" with `midpoint=0.5)
label_party_margin()
midpoint=0
If TRUE, reverse "D" and "R".
TRUE
As with scales::number_format
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))
Run the code above in your browser using DataLab