binsFromCols: Concatenate the column names from a logical data.frame

Description Usage Arguments Details Value Author(s) Examples

Description

This checks that a data.frame is all logical values, then concatenates the column names using the given separator.

Usage

1
binsFromCols(df, collapse = "_")

Arguments

df

The data.frame

collapse

The separator to use between the character variables in the column names

Details

This is useful for turning sets of logical vectors into concatentaed strings able to be used for assigning values to bins.

Value

A character vector

Author(s)

Steve Pederson

Examples

1
2
3
t <- c(TRUE, FALSE)
x <- data.frame(Type1 = sample(t, 10, TRUE), Type2 = sample(t, 10, TRUE))
binsFromCols(x)

steveped/funsForLu documentation built on May 30, 2019, 5:39 p.m.