Skip to contents

applies statistical functions to all columns of a data frame

Usage

colStatistics(
  dataFrame,
  functions = c("sum", "mean", "min", "max", "number.na", "length"),
  na.rm = FALSE,
  functionColumn = FALSE
)

Arguments

dataFrame

data frame with numeric columns only

functions

vector of statistical functions to be applied on each column of dataFrame possible values: "sum", "mean", "min", "max", "number.na" (number of NA values), "length" (number of values)

na.rm

if TRUE, NA values are removed before applying the statistical function(s)

functionColumn

if TRUE, a column containing the function name is contained in the result data frame, otherwise the function names become the row names of the result data frame