Description Usage Arguments Value Examples
Calculates the party nationalization index (PNI).
1 | calc_pni(prop_votes)
|
prop_votes |
A vector of party vote proportions. |
A vector of length 1 with the PNI.
1 2 3 4 5 6 7 8 9 10 11 12 | data(camara_dept)
# apply function to one party
camara_dept %>%
filter(party == "ALIANZA VERDE") %>%
summarize(inp = calc_pni(prop_votes_party))
# apply function to all parties
camara_dept %>%
filter(party != "VOTO EN BLANCO") %>%
group_by(party) %>%
summarize(inp = calc_pni(prop_votes_party))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.