plot.prcalc_index_compare | R Documentation |
prcalc_index_compare
object.Visualization of a prcalc_index_compare
object.
## S3 method for class 'prcalc_index_compare'
plot(
x,
index = NULL,
style = "bar",
bar_width = 0.75,
point_size = 5,
facet = FALSE,
free_x = TRUE,
font_size = 12,
facet_col = 4,
legend_pos = "bottom",
...
)
x |
a |
index |
a character vector of disproportionality indices. If |
style |
Plot style. Lollipop ( |
bar_width |
Default is |
point_size |
Default is |
facet |
Separate facets by indices? Default is |
free_x |
Default is |
font_size |
a font size. Default is |
facet_col |
a number of columns of facets. Default is |
legend_pos |
a position of legend. Default is |
... |
Ignored |
A ggplot
object.
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)
list("t = 0%" = index(pr_obj1),
"t = 2.5%" = index(pr_obj2),
"t = 5%" = index(pr_obj3)) |>
compare() |>
plot()
list("t = 0%" = index(pr_obj1),
"t = 2.5%" = index(pr_obj2),
"t = 5%" = index(pr_obj3)) |>
compare() |>
plot(index = c("lh", "gallagher", "rae", "dhondt", "ad"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.