onezero: 1/0 Flags

View source: R/utilities.R

onezeroR Documentation

1/0 Flags

Description

Turns Yes/No variables into 1/0 integers

Usage

onezero(x)

Arguments

x

a character vector

Details

The input is forced to lowercase and only the first character, the "y" or "n", is used to map to the 1/0 integer values. The function allows for "1" and "0" to be in the character vector as well.

Value

an integer vector

Examples


flag <- c("Y", "No", "NO", "no", "n", "YES", "Yes", "yEs", "1", "0")
onezero(flag)


pedalfast.data documentation built on Nov. 11, 2023, 1:07 a.m.