calculate_average: Return an array of average of specific columns matching a...

Description Usage Arguments Value Examples

View source: R/calculate_average.R

Description

Return an array of average of specific columns matching a pattern

Usage

1

Arguments

df

A data frame

pattern

A string pattern to match

Value

A vector of average of specific columns matching a pattern

Examples

1
2
3
4
5
6
7
df <- data.frame(
    week_payment1 = c(1, 2, 3),
    week_payment2 = c(4, 5, 6),
    week_payment3 = c(7, 8, 9),
    other_column = c(10, 11, 12)
)
calculate_average(df, "week_payment")

UBC-MDS/featurescreator documentation built on Feb. 5, 2022, 8:12 a.m.