Skip to content

Commit

Permalink
Update standard_summary.R - added sum to the function
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTang authored Sep 12, 2024
1 parent edc7f9f commit 2c7a69a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/standard_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
}
}

0 comments on commit 2c7a69a

Please sign in to comment.