Draws a small multiples type of Pareto Chart grouped by a categorical variable
draw_pareto_chart_grouped(
data,
cat_var,
grouping_var,
summarize = FALSE,
continuous_var,
drop_na = TRUE,
highlight_first_n_items = 0,
lump_last_n_items = 0,
lumped_cat_name = "Other",
color = "one",
scale = "numeric",
accuracy = 1,
title_label = "Pareto Chart",
analysis_desc_label = NULL,
axis_text_size = 10,
x_axis_span = "free"
)
A 'ggplot' object
input dataset to be plotted (required)
Categorical variable (required)
Grouping variable (required)
Logical. If FALSE, default, the function expects total counts of each category of the categorical variable. If TRUE, individual values within each category are automatically summed up and ranked. (required)
Continuous variable to rank by (e.g. sum, frequency etc.). Not required if summarize argument is set to TRUE. (required)
Logical. If TRUE, default, NA values of the categorical variable are dropped. (required)
Specify the top n items to be highlighted. By default, it is set to 0. (optional)
Specify the last n items to be lumped into one category. By default, it is set to 0. (optional)
Name lumped category. By default, it is set to "Other". (optional)
Set panel fill color for facets. Options are "one" (one color) or "multi" (each panel is a different color). By default, it is set to "one". (optional)
Specify an acceptable argument for scale. Acceptable arguments are "numeric", "percent", "dollar", "dollar-k" or "dollar-M". By default, it is set to "numeric" (optional)
Number to round to. Default value is set to 1. If NULL, values will be rounded to the nearest integer. (optional)
Specify plot title. By default, it is set to display "Pareto Chart" (optional)
Specify plot analysis desc label (subtitle). By default, it is set to display CONTINUOUS VARIABLE COLUMN NAME "by" CATEGORICAL VARIABLE COLUMN NAME (optional)
Set axis text size. By default, it is set at 10. (optional)
Set X axis span. Options are "free" (a different span for each panel based on range of values for each panel) and "fixed" (the X axes in all panels are set to span the total range of all values). By default, it is set to "free". (optional)