From 2c7a69a4c96fac81cf0fa5d8d4d2f34d37ad93a4 Mon Sep 17 00:00:00 2001 From: LukasTang <49587161+LukasTang@users.noreply.github.com> Date: Thu, 12 Sep 2024 21:24:30 +0200 Subject: [PATCH] Update standard_summary.R - added sum to the function --- R/standard_summary.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/standard_summary.R b/R/standard_summary.R index a1833aa668..4ba9593d7f 100644 --- a/R/standard_summary.R +++ b/R/standard_summary.R @@ -27,6 +27,7 @@ #' #' @export standard_summary <- function(df, vars, functions = list( + sum = ~sum(.x, na.rm = TRUE) mean = ~mean(.x, na.rm = TRUE), sd = ~sd(.x, na.rm = TRUE), min = ~min(.x, na.rm = TRUE), @@ -47,4 +48,4 @@ standard_summary <- function(df, vars, functions = list( pivot_longer(cols = contains("xx")) %>% separate(name, into = c("VARIABLE", "STAT"), sep = "xx_xx") %>% pivot_wider(id_cols = c(gg, "VARIABLE"), values_from = value, names_from = STAT) -} \ No newline at end of file +}