Suitable for use within ggplot's ggplot2::stat_summary.

mean_ci_t(x, alpha = 0.05, na.rm = TRUE)

Arguments

x

A Numeric vector.

alpha

Alpha, default is 0.05.

na.rm

If TRUE (default), missing values are dropped.

Value

A data.frame with y (mean), ymin and ymax values.

Examples

set.seed(42) df <- data.frame(x = runif(100), y = sample(c("A", "B"), 100, TRUE)) mean_ci_t(df$x)
#> y ymin ymax #> 1 0.52447875 0.46456593 0.58439156