Calculates mean, standard deviation, median, min, max, and number of missing values for the columns of a matrix or for a vector.

column_summary_stats(x, n_digits = c(2, 2, 2, 3, 1), rowNames = colnames(x))

Arguments

x

A matrix, data frame, or vector.

n_digits

An optional vector of length 5 that indicates the number of digits after the decimal place that will be used for rounding and formatting the mean, sd, median, min, and max, respectively. Default is c(2, 2, 2, 3, 1)]. If NULL, no rounding or formatting will be done.

rowNames

Names for the rows of output. Default will use column names of x as rows.

Value

A data frame with columns mean, sd, median, min, max, and number of missing values. Each row corresponds to the columns of the input.