powered by
"Y"
"N"
Map "Y" and "N" to numeric values.
yn_to_numeric(arg)
1 if arg equals "Y", 0 if arg equals "N", NA_real_ otherwise
1
arg
0
NA_real_
Character vector
Utilities for Formatting Observations: convert_blanks_to_na(), convert_na_to_blanks()
convert_blanks_to_na()
convert_na_to_blanks()
yn_to_numeric(c("Y", "N", NA_character_))
Run the code above in your browser using DataLab