mean_sd: Compute Mean and its Standard Deviation for ggplot2

View source: R/ggplot2_summaries.R

mean_sdR Documentation

Compute Mean and its Standard Deviation for ggplot2

Description

Compute mean and standard deviation for a given vector. Can be used as fun.data in ggplot2's stat_summary. This comes in very handy for plotting means and standard deviations as no further arguments must be submitted.

Usage

mean_sd(x)

Arguments

x

A numeric vector.

Value

A tibble with columns ymin, mean, and ymax.

Examples

x <- rnorm(200)

mean_sd(x)

benediktclaus/benelib documentation built on Feb. 1, 2024, 1:39 a.m.