From 1061c7879b49aecd9e394b4916b4f32c1a08707f Mon Sep 17 00:00:00 2001 From: jbengler Date: Mon, 16 Dec 2024 11:26:43 +0100 Subject: [PATCH] Re-write mean_sd() --- R/helpers.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/helpers.R b/R/helpers.R index 0baf9d0..937e7d8 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -259,8 +259,10 @@ min_max <- function(x) { } mean_sd <- function(x) { - dplyr::rename(data.frame(as.list(Hmisc::smean.sdl(x, mult = 1))), - y = Mean, ymin = Lower, ymax = Upper) + x <- stats::na.omit(x) + data.frame(y = mean(x), + ymin = mean(x) - stats::sd(x), + ymax = mean(x) + stats::sd(x)) } mean_cl_boot <- function(x) {