onezero {pedalfast.data}R 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)


[Package pedalfast.data version 1.0.1 Index]