Printing a prcalc_index_compare object.

Description

Printing a prcalc_index_compare object.

Usage

## S3 method for class 'prcalc_index_compare'
print(x, subset = NULL, hide_id = FALSE, use_gt = FALSE, digits = 3, ...)

Arguments

x a prcalc_index_compare object.
subset a
hide_id a
use_gt a
digits the number of decimal places. Default is 3.
ignored.

Examples

library("PRcalc")

data(jp_upper_2019)

pr_obj1 <- prcalc(jp_upper_2019, m = 50, method = "dt")
pr_obj2 <- prcalc(jp_upper_2019, m = 50, method = "dt", threshold = 0.025)
pr_obj3 <- prcalc(jp_upper_2019, m = 50, method = "dt", threshold = 0.05)

compare(list("t = 0%" = pr_obj1, "t = 2.5%" = pr_obj2, "t = 5%" = pr_obj3))
       Party t = 0% t = 2.5% t = 5%
1      Jimin     18       19     20
2      Komei      7        7      7
3   Ritsumin      8        9      9
4      Ishin      5        5      5
5     Kyosan      5        5      5
6    Kokumin      3        3      4
7      Reiwa      2        2      0
8     Shamin      1        0      0
9        NHK      1        0      0
10 Anrakushi      0        0      0
11    Kofuku      0        0      0
12     Olive      0        0      0
13   Rodosha      0        0      0
list("t = 0%"   = index(pr_obj1),
     "t = 2.5%" = index(pr_obj2),
     "t = 5%"   = index(pr_obj3)) |>
  compare() |>
  print(subset  = c("lh", "gallagher", "rae", "dhondt", "ad"),
        hide_id = TRUE)
              Index  t = 0% t = 2.5% t = 5%
1           D’Hondt 1.11683   1.1383 1.1507
2               Rae 0.00466   0.0108 0.0155
3 Loosemore & Hanby 0.03032   0.0700 0.1005
4         Gallagher 0.01461   0.0345 0.0543
5  alpha-Divergence 0.00923   0.0319 0.0566