calc_means_df: Calculate means

Description Usage Arguments Examples

View source: R/calc_means_df.R

Description

Calculate mean values for the specified columns of a dataframe. Output is appended into the initial dataframe.

Usage

1
calc_means_df(x, groups, na.rm = TRUE)

Arguments

x

Data frame with the input values.

groups

List containing column identifiers for the different groups. The name of each element will be used as column name containing the mean. Each element is a vector containing possible identifiers for the columns. Identifiers can match partially with the columns of interest.

na.rm

Logical with default value TRUE, indicating whether the NA values should be taken into account when calculating the means. See mean function.

Examples

1
2
3
groups <- list(mean_A = "group A",
               mean_B = c("^B", <e2><80><9c>groupB<e2><80><9d>)
data <- calc_means_df(x = input, groups = groups)

tkostas/komics documentation built on May 24, 2019, 7:31 a.m.