make_mean_std_dev_by_group_table: Get mean and standard deviation of variables by group

Description Usage Arguments Value Examples

View source: R/tables.R

Description

Get mean and standard deviation of variables by group

Usage

1
make_mean_std_dev_by_group_table(data, group_column, columns, total_row = TRUE)

Arguments

data

A data.frame with the data you want to make the table from.

group_column

A string with the name of the variable you are grouping by

columns

A string or vector of strings for the variables you want to get the mean and standard deviation for.

total_row

A boolean (default TRUE) for whether to include a row a the bottom for the overall mean and standard deviation (i.e. not by group).

Value

A data.frame with the first column showing the category grouped by. Then one column for each variable you want the mean and standard deviation for. Will give the mean and standard deviation as a single string with the standard deviation in parentheses.

Examples

1
make_mean_std_dev_by_group_table(mtcars, "gear", c("mpg", "disp"))

crimeutils documentation built on Feb. 3, 2021, 5:07 p.m.