Also returns numeric for single character Sex characters "F" and "M"

sexf(sex)

Arguments

sex

Sex character

Value

the standard yspec numeric value for the inputted Sex character

Examples

sexf("FEMALE") # 1
#> [1] 1
sexf("female") # 1
#> [1] 1
sexf("f") # 1
#> [1] 1

sexf("MALE") # 0
#> [1] 0

sexf("NOT SPECIFIED") # 0
#> [1] 0