Last chance! 50% off unlimited learning
Sale ends in
Part of Pedigree Curation
convertSexCodes(sex, ignoreHerm = TRUE)
factor with levels: "M", "F", "U". Sex specifier for an individual.
logical flag indicating if hermaphrodites should be
treated as unknown sex ("U"), default is TRUE
.
A vector of factors representing standardized sex codes after transformation from non-standard codes.
Standard sex codes are
F -- replacing "FEMALE" or "2"
M -- replacing "MALE" or "1"
H -- replacing "HERMAPHRODITE" or "4", if ignore.herm == FALSE
U -- replacing "HERMAPHRODITE" or "4", if ignore.herm == TRUE
U -- replacing "UNKNOWN" or "3"
# NOT RUN {
library(nprcgenekeepr)
original <- c("m", "male", "1", "MALE", "M", "F", "f", "female",
"FemAle", "U", "Unknown", "H", "hermaphrodite",
"U", "Unknown", "3", "4")
sexCodes <- convertSexCodes(original)
sexCodes
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab