Learn R Programming

ei.Datasets (version 0.0.1-3)

merge_small_options: Merge small parties and/or candidates

Description

Merge small parties and also small candidates by, respectively, aggregating them in the options 'Other parties votes' and 'Other candidates votes'.

Usage

merge_small_options(x, min.party, min.candidate)

Arguments

x

A tibble with the same components and structure as the tibbles in the ei.Datasets package. For instance, like the ei_NZ_2020 object.

min.party

A number between 0 and 100. Those parties which individually did not reach at least min.party% of the election-district vote are grouped in the option <U+2018>Other parties votes<U+2019>.

min.candidate

A number between 0 and 100. Those candidates which individually did not reach at least min.candididate% of the election-district vote are grouped in the option <U+2018>Other candidates votes<U+2019>.

Value

A tibble similar to x with small parties and candidates merged on, respectively, <U+2018>Other parties votes<U+2019> and <U+2018>Other candidates votes<U+2019>, with min.party and min.candidate used to determine when an electoral option is small.

References

Pavia, JM (2021). ei.Datasets: Real datasets for assessing ecological inference algorithms, Social Science Computer Review, forthcoming.

See Also

ei_NZ_2002 ei_NZ_2005 ei_NZ_2008 ei_NZ_2011 ei_NZ_2014 ei_NZ_2017 ei_NZ_2020 ei_SCO_2007

Examples

Run this code
# NOT RUN {
collapsed.tibble <- merge_small_options(x = ei_NZ_2020, min.party = 3, min.candidate = 5)

# }

Run the code above in your browser using DataLab