ggvis (version 0.4.3)

compute_boxplot: 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

Run this code
# NOT RUN {
mtcars %>% compute_boxplot(~mpg)
mtcars %>% group_by(cyl) %>% compute_boxplot(~mpg)
# }

Run the code above in your browser using DataCamp Workspace