make_boxplot1: Boxplot for Numeric Grouped by Categorical

View source: R/see_num_vars.R

make_boxplot1R Documentation

Boxplot for Numeric Grouped by Categorical

Description

Create a boxplot to display the distribution of a numeric variable grouped by a categorical variable. Good for categorical variable 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. Median for each category is labeled in the box.

Usage

make_boxplot1(data, num_var, cat_var, plot_title, vjust = 1.5)

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

plot_title

title for the plot as a string

vjust

position of the median labels

Value

none

Examples

make_boxplot1(ggplot2::diamonds, "price", "cut", "Price of Diamonds by Cuts")

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