ezr.find_columns_containing: Find Columns that contain particular values...such as Find...

Description Usage Arguments Value Examples

Description

Often you want to find columns that are all 0s and 1s...or something else like Y and N. This function allows you to determine which columns contain the values you are after. Default is 0 and 1. There is a flag on whether you want to allow NULL for considering the condition to be met.

Usage

1
2
ezr.find_columns_containing(dataset, values = c(0, 1),
  allow_null = TRUE, any_or_only = "only", return_only_true = TRUE)

Arguments

dataset

dataframe

values

the values that you want to check for. Default is 0 and 1 (checking for binary columns)

allow_null

Should NULL be allowed? Default is TRUE. This means a condition will be met if NA is found in the column.

any_or_only

ANY = does it contain only these values? Only: Does it contain only these values?

return_only_true

Return a vector of true columns or all columns with trues and falses.

Value

vector of columns if return_only_true is TRUE or a dataframe if return_only_true is ALSE

Examples

1
#ezr.find_columns_containing(dataset = mtcars, values = c(0,1), allow_null=FALSE, any_or_only ='only', return_only_true = TRUE)

jmp1989/easyr documentation built on May 20, 2019, 7:25 a.m.