get_sum_stats: Calculate summary statistics

View source: R/get_sum_stats.R

get_sum_statsR Documentation

Calculate summary statistics

Description

Calculate summary statistics

Usage

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(s)

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

Examples

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

RHReynolds/rutils documentation built on March 26, 2022, 8:17 a.m.