powered by
hasBothParents checks to see if both parents are identified.
hasBothParents(id, ped)
TRUE if ID has both sire and dam identified in ped.
ped
character vector of IDs to examine for parents
a pedigree
library(nprcgenekeepr) ped <- nprcgenekeepr::pedOne names(ped) <- c("id", "sire", "dam", "sex", "birth") hasBothParents("o2", ped) ped$sire[ped$id == "o2"] <- NA hasBothParents("o2", ped)
Run the code above in your browser using DataLab