make_boxplot2 | R Documentation |
Create a boxplot to compare the distribution of a numeric variable grouped by a categorical variable among the different levels of another categorical variable. Good for categorical variables that has ten or less categories. When the maximum observations for a category is < 200, each observation will be plotted and outliers will be hidden, vice versa for observations >= 200.
make_boxplot2(data, num_var, cat_var, grp_var, label_fmt = TRUE)
data |
dataset that contains the variables |
num_var |
name of the numeric variable as a string |
cat_var |
name of the categorical variable as a string |
grp_var |
name of the categorical variable as a string |
label_fmt |
boolean to indicate whether plot labels should be formatted |
none
make_boxplot2(ggplot2::diamonds, "price", "cut", "color")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.