ggplot.boxplot.stats: Calculate boxplot statistics for ggplot

View source: R/functions.R

ggplot.boxplot.statsR Documentation

Calculate boxplot statistics for ggplot

Description

Calculate boxplot statistics for ggplot

Usage

ggplot.boxplot.stats(df, group_by, value.col, ncpu = 1)

Arguments

df

input data.frame.

group_by

column names or indices used for grouping data

value.col

column name of index of a value used to calculate boxplot statistics

ncpu

number of cores to calculate statistics. If more than 1 parallel::mclapply function will be used

Details

uses boxplot.stats as backend. All columns not in group_by will be dropped in output data.frame with outliers

Value

list of two data.frames, the first one with boxplot statistics and the second one with outliers

Examples

d <- data.frame(a = sample(LETTERS[1:3], 100, replace = TRUE), 
                b = sample(LETTERS[1:3], 100, replace = TRUE), 
                c = sample(c(1:3, 10), 100, replace = TRUE),
                d = sample(c(1:3, 10), 100, replace = TRUE))
                
ggplot.boxplot.stats(d, c("a", "b"), 3L)
ggplot.boxplot.stats(d, c("a", "b"), "c")                 

DrrDom/pfpp documentation built on April 17, 2024, 10:24 a.m.