compute_boxplot: Calculate boxplot values

View source: R/compute_boxplot.R

compute_boxplotR Documentation

Calculate boxplot values

Description

Calculate boxplot values

Usage

compute_boxplot(x, var = NULL, coef = 1.5)

Arguments

x

Dataset-like object to compute boxplot values. There are built-in methods for data frames, grouped data frames, and ggvis visualisations.

var

Name of variable for which to compute boxplot values. The variable must be continuous.

coef

The maximum length of the whiskers as multiple of the inter-quartile range. Default value is 1.5.

Value

A data frame with columns:

min_

Lower whisker = smallest observation greater than or equal to lower hinge - 1.5 * IQR

lower_

Lower hinge (25th percentile)

median_

Median (50th percentile)

upper_

Upper hinge (75th percentile)

max_

Upper whisker = largest observation less than or equal to upper hinge + 1.5 * IQR

outliers_

A vector of values that are outside of the min and max

See Also

layer_boxplots

Examples

mtcars %>% compute_boxplot(~mpg)
mtcars %>% group_by(cyl) %>% compute_boxplot(~mpg)

ggvis documentation built on May 29, 2024, 1:12 a.m.