summarySE: Summarise an input matrix

View source: R/clustering.R

summarySER Documentation

Summarise an input matrix

Description

Matrix summarization function adapted from http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)the R cookbook.

Usage

summarySE(
  data = NULL,
  measurevar,
  groupvars = NULL,
  na.rm = FALSE,
  conf.interval = 0.95,
  add_medians = FALSE,
  .drop = TRUE
)

Arguments

data

A data frame. Expects all values for summarisation to be in one column, which may requie judicious use of melt.

measurevar

The name of a column that contains the variable to be summariezed

groupvars

A vector containing names of columns that contain grouping variables

na.rm

A boolean that indicates whether to ignore NA's

conf.interval

The percent range of the confidence interval (default is 95 percent)

add_medians

Logical indicating whether medians should be added to the output. Standard error estimates for the median require bootstrapping, so TRUE for this variables make summary statistic calculation take longer.

.drop

Logical passed to ddply()

Details

Uses bootstrapping to return the standard error/ deviation of the median.

Value

out Data frame with summary statistics

Examples

tg <- ToothGrowth
summarySE(tg, measurevar = "len", groupvars = c("supp", "dose"))


pinin4fjords/shinyngs documentation built on Feb. 28, 2024, 10:19 a.m.