yn_to_numeric: Map '"Y"' and '"N"' to Numeric Values

View source: R/user_utils.R

yn_to_numericR Documentation

Map "Y" and "N" to Numeric Values

Description

Map "Y" and "N" to numeric values.

Usage

yn_to_numeric(arg)

Arguments

arg

Character vector

Value

1 if arg equals "Y", 0 if arg equals "N", NA_real_ otherwise

See Also

Utilities for Formatting Observations: convert_blanks_to_na(), convert_na_to_blanks()

Examples


yn_to_numeric(c("Y", "N", NA_character_))

admiral documentation built on Oct. 19, 2023, 1:08 a.m.