prcalc | R Documentation |
Proportional Representation Calculator
prcalc(x, m, method, extra = NULL, threshold = 0)
x |
a |
m |
a numeric vector of district magnitude. |
method |
a character string giving a method for computing seat allocation. See "Allocation methods" section. |
extra |
a numeric vector of length |
threshold |
a threshold. It must be equal or larger than 0 (0%) and smaller than 0.1 (10%). a default is 0. |
a prcalc
object
aaa
Custom methods ("custom divisor"
and "custom quota"
) require extra
parameter. In the case of "custom divisor"
("cd"
), a numeric vector of the same length as the magnitude (m
) must be specified. If the magnitude (m
) is a vector of length 2 or longer, the extra
must have a length equal to max(m)
. For example, if m = c(5, 7, 4)
, then the length of the extra must be 7.
In the case of "custom quota"
, extra
must be a vector of the same length as m
. For example, if m = c(5, 7, 4)
, extra
must also be a numeric vector of length 3. If length of extra
is 1, the same quota is applied to all blocks.
print.prcalc
, summary.prcalc
, plot.prcalc
data(jp_upper_2019)
data(jp_lower_2021)
prcalc(jp_upper_2019, m = 50, method = "dt")
japan_2021 <- prcalc(jp_lower_2021,
m = c(8, 14, 20, 21, 17, 11, 21, 30, 11, 6, 21),
method = "hare")
japan_2021
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.