yesno.as.logical: yesno.as.logical

View source: R/yesno.as.logical.R

yesno.as.logicalR Documentation

yesno.as.logical

Description

Convert a vector of Yes/No or Yes/NA values to logical.

Usage

yesno.as.logical(v)

Arguments

v

a character vector to convert

Value

a logical vector. Values of "Y" and "Yes" are converted to TRUE. All other values, including NA, are converted to FALSE.

Examples


foo  <- c("Y", NA, "Y", NA)
yesno.as.logical(foo)

foo  <- c("Y", NA, "Y", "Yes",NA, "No", "N","something else")
yesno.as.logical(foo)

crazybilly/ucbudar documentation built on July 15, 2024, 5:03 p.m.