make_boxplot2: Boxplot for Numeric Grouped by Two Categoricals

View source: R/see_num_vars.R

make_boxplot2R Documentation

Boxplot for Numeric Grouped by Two Categoricals

Description

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.

Usage

make_boxplot2(data, num_var, cat_var, grp_var, label_fmt = TRUE)

Arguments

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

Value

none

Examples

make_boxplot2(ggplot2::diamonds, "price", "cut", "color")

sarazong/SZRtools documentation built on Feb. 8, 2024, 6:49 a.m.