find_binary: find_binary

View source: R/find_binary.R

find_binaryR Documentation

find_binary

Description

Returns either a vector with all clearly binary variables or a list with additional information on variables that might also be binary.

Usage

find_binary(
  .data,
  .output = "bin",
  .include = FALSE,
  .yes = NULL,
  .no = NULL,
  .na = NULL,
  .print = TRUE
)

Arguments

.data

A data.frame or tibble.

.output

"bin" returns a vector of binary variables, "list" returns a list with binary variables, variables coded yes/no and more information.

.include

If .include = TRUE, variables recoded as 0/1 within the function are returned in the list-output - requires .output = "list".

.yes

Optional character vector that can be used to feed values that should be used as 'yes'.

.no

Optional character vector that can be used to feed values that should be used as 'no'.

.na

Optional character vector that can be used to feed values that should be used as 'NA'.

.print

If .print = TRUE, values detected as yes/no are printed.

Value

Either a character vector with clearly binary variables or a list with additional information.

Examples

-

janbrederecke/prepareD documentation built on Oct. 26, 2022, 8:06 p.m.