Calculate summary statistics

get_sum_stats(
  df,
  sum_vars,
  group_vars = NULL,
  sum_funcs = list(mean = base::mean, sd = stats::sd, median = stats::median, iqr =
    stats::IQR)
)

Arguments

df

a data.frame object.

sum_vars

character() vector with name of columns to summarize.

group_vars

character() vector with name of columns to group_by()

sum_funcs

either function or list of functions. By default, uses base::mean(), stats::sd(), stats::median(), stats::IQR().

Value

tibble object containing summarized data.

Author

David Zhang https://github.com/dzhang32/rutils

Examples

iris_summary <- get_sum_stats( iris, sum_vars = "Sepal.Length", group_vars = "Species" )