Map "Y"
and "N"
to numeric values.
See also
Utilities for Formatting Observations:
convert_blanks_to_na()
,
convert_na_to_blanks()
Examples
yn_to_numeric(c("Y", "N", NA_character_))
#> [1] 1 0 NA
Map "Y"
and "N"
to numeric values.
Utilities for Formatting Observations:
convert_blanks_to_na()
,
convert_na_to_blanks()
yn_to_numeric(c("Y", "N", NA_character_))
#> [1] 1 0 NA