Learn R Programming

jwutil (version 1.1.1)

binary_col_names: names of fields which are numeric, binary or combinations thereof

Description

Doesn't make any allowance for factors.

Usage

binary_col_names(x, invert = FALSE)

binary_cols(x, invert = FALSE)

numeric_col_names(x, invert = FALSE)

numeric_cols(x, invert = FALSE)

Arguments

x

data frame

invert

single logical, if true, will return non-binary columns

Value

vector of column names

Examples

Run this code
# NOT RUN {
dat <- data.frame(c("a", "b"), c(TRUE, FALSE), c(1, 0), c(1L, 0L),
                  c(1L, 2L), c(0.1, 0.2), c("9", "8"))
names(dat) <- c("char", "bin", "binfloat", "binint",
                "int", "float", "charint")
binary_cols(dat)
binary_col_names(dat)
binary_col_names(dat, invert = TRUE)
# }

Run the code above in your browser using DataLab