uwBox: Box Plot function embedded in other box plot functions

Description Usage Arguments Details Value Author(s) Examples

View source: R/uwBox.R

Description

Function called by other box plot functions to actually create the box plot. This allows for a consistent look throughout multiple different functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
uwBox(
  data,
  trxName = NULL,
  metricName,
  yLab = NULL,
  xLab = NULL,
  yLim = NULL,
  boxWex = 0.75,
  plotMean = TRUE,
  pOutliers = TRUE
)

Arguments

data

data frame with metricName and trxName as columns

trxName

column name of treatment factor in data

metricName

column name of numeric variable in data

yLab

(boxplot)(string) Y-axis label

xLab

(boxplot)(string) X-axis label

yLim

(boxplot)(numeric vector) Y-axis range

boxWex

(boxplot)(numeric) see boxplot

plotMean

(logical) if TRUE a dot will be plotted for where the mean is

pOutliers

(logical) if TRUE outliers are plotted

Details

This function is an adaptation of the traditional boxplot() so that box plot functions in biostatrpts can be similar

uwBox is called by any biostatrpts function that creates box plots.

Value

Returns a list of sample sizes (n), means (mean), standard deviations (sd), minimums (min), first quartile (q25), medians (median), third quartile (q75), maximums (max)

Author(s)

University of Wisconsin-Madison Biostatistics and Medical Informatics Department, Scott Hetzel M.S.

Examples

1
2
3
4
5
6
TRT <- c(rep("A", 20), rep("B", 20), rep("C", 20))
metric <- c(rnorm(20, 2, 1), rnorm(20, 3, 1), rnorm(20, 4, 1))

dat <- data.frame(TRT, metric)

uwBox(dat, "TRT", "metric")

jbirstler/biostatrpts documentation built on May 7, 2020, 12:10 a.m.