powered by
Functions for retrieving or changing the gender codes of specified pedigree members.
getSex(x, ids = labels(x))swapSex(x, ids, verbose = TRUE)
swapSex(x, ids, verbose = TRUE)
A ped object or a list of such.
ped
A character vector (or coercible to one) containing ID labels.
A logical: Verbose output or not.
getSex() returns an integer vector of the same length as ids, with entries 0 (unknown), 1 (male) or 2 (female).
getSex()
ids
swapSex() returns a ped object similar to the input, but where the gender codes of ids (and their spouses) are swapped (1 <-> 2).
swapSex()
ped()
# NOT RUN { x = nuclearPed(1) stopifnot(all(getSex(x) == c(1,2,1))) swapSex(x, 3) # }
Run the code above in your browser using DataLab