get_matching_column_names: Returns a subset of the columns whose names match the...

Description Usage Arguments Value Examples

View source: R/get_matching_column_names.R

Description

Matching columns are columns whose names start with the given pattern and end with an incrementing integer.

Usage

1

Arguments

df

The dataframe from which to extract columns

pattern

The prefix of the column names to extract (string)

Value

A vector of strings that match the pattern

Examples

1
2
3
data <- data.frame(week_payment1 = c(1, 2, 3), week_payment2 = c(1, 2, 3),
                   week_payment3 = c(1, 2, 3), othercolumn = c(5, 6, 7))
get_matching_column_names(data, "week_payment")

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