powered by
Compute grouped mean ± SD and min–max summary statistics for one or more numeric variables.
descriptive_statistic(data, vars, groups, digits = 2)
A tibble with one row per group and two summary columns per variable (`<var>_mean_sd` and `<var>_min_max`).
A data frame.
<[`tidy-select`][dplyr::dplyr_tidy_select]> Columns to summarise.
<[`tidy-select`][dplyr::dplyr_tidy_select]> Grouping columns.
Number of decimal places to round to. Default is 2.
df <- data.frame(group = c("A","A","B","B"), value = c(1.1, 2.3, 3.5, 4.7)) descriptive_statistic(df, vars = value, groups = group)
Run the code above in your browser using DataLab