Skip to contents

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)
#>             y       ymin      ymax
#> 1 0.005611582 -0.9817063 0.9929295