top_n_boxplot: Show top N values of each group on the boxplot

Description Usage Arguments Details Value Examples

View source: R/top_n_boxplot.R

Description

This function adds top N highest values of every group to the boxplot visualization

Usage

1
top_n_boxplot(dataset, value, group, n = 10)

Arguments

dataset

Dataframe or tibble with at least two columns

value

A numeric column that is used for ordering

group

A factor or character column used for grouping

n

An integer showing the number of top values to be plotted. Default value is 10.

Details

Function would not work if any of the groups has less than n observations

Value

A ggplot object, visualization with two layers (boxplot and scatterplot)

Examples

1
2
3
mtcars %>%
dplyr::mutate(am = as.factor(am)) %>%
top_n_boxplot(mpg, am, 5)

mlaricheva/fancybox documentation built on Dec. 21, 2021, 7:57 p.m.