yn_to_numeric {admiral}R 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

Author(s)

Stefan Bundfuss

See Also

Utilities for Formatting Observations: convert_blanks_to_na(), format_eoxxstt_default(), format_reason_default()

Examples


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

[Package admiral version 0.8.4 Index]