This function applies a specified function to each group defined by a regular expression pattern applied to the names of a data object. It is useful for summarizing data when groups are defined by a pattern in the names rather than a specific column or index.
groupStat(f, x, xname = names(x), patterns)
A data frame or matrix containing the summary statistics for each group.
A function that takes a single argument and returns a summary of the data.
A data frame or matrix containing the data to be summarized.
A character vector containing the names of the variables in x
.
A character vector of regular expressions that define the groups.