powered by
Returns descriptive statistics by group
desc_stats_by_group( data = NULL, var_for_stats = NULL, grouping_vars = NULL, sigfigs = NULL, cols_to_round = NULL )
the output will be a data.table showing descriptive statistics of the variable for each of the groups formed by the grouping variables.
a data object (a data frame or a data.table)
name of the variable for which descriptive statistics will be calculated
name(s) of grouping variables
number of significant digits to round to
names of columns whose values will be rounded
desc_stats_by_group(data = mtcars, var_for_stats = "mpg", grouping_vars = c("vs", "am"))
Run the code above in your browser using DataLab