calcErrorBars: Calculate Error Bars

View source: R/calcErrorBars.R

calcErrorBarsR Documentation

Calculate Error Bars

Description

Calculate error bars for given measurement column in data_dt.

Usage

calcErrorBars(
  data_dt,
  kind_v = "MSEM",
  col_v = "value",
  groupCol_v,
  fCol_v = NA,
  fVal_v = NA
)

Arguments

data_dt

input data.table (most likely melted and ready for ggplot)

kind_v

which bars to make. MSEM = mean +/- SEM; MSD = mean +/- sd; MQ = median and lower/upper quartiles

col_v

which column in data_dt is the measurement that is used.

groupCol_v

which column to group calculations by. Treatment is common

fCol_v

which column to further group calcs by. Used if faceting the output.

fVal_v

values of fCol_v to group by.

Details

Will calculate center and upper/lower bounds of disribution by one of two methods and add columns to data_dt labeled "Lower", "Middle", and "Upper". Will group calculated error bars by a grouping column and can further subdivide by a second column.


weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.