desc_stats_by_group: Descriptive statistics by group

Description Usage Arguments Value Examples

View source: R/desc_stats_by_group.R

Description

Returns descriptive statistics by group

Usage

1
2
3
4
5
6
7
desc_stats_by_group(
  data = NULL,
  var_for_stats = NULL,
  grouping_vars = NULL,
  sigfigs = NULL,
  cols_to_round = NULL
)

Arguments

data

a data object (a data frame or a data.table)

var_for_stats

name of the variable for which descriptive statistics will be calculated

grouping_vars

name(s) of grouping variables

sigfigs

number of significant digits to round to

cols_to_round

names of columns whose values will be rounded

Value

the output will be a data.table showing descriptive statistics of the variable for each of the groups formed by the grouping variables.

Examples

1
2
desc_stats_by_group(data = mtcars, var_for_stats = "mpg",
grouping_vars = c("vs", "am"))

kim documentation built on April 25, 2021, 1:06 a.m.