editPed {pedigreeTools} | R Documentation |
Edits a disordered or incomplete pedigree
Description
Edits a disordered or incomplete pedigree by:
1) adding labels for the sires and dams not listed as labels before and
2) ordering pedigree based on recursive calls to getGenAncestors
.
Usage
editPed(sire, dam, label, verbose = FALSE)
Arguments
sire |
integer vector or factor representation of the sires |
dam |
integer vector or factor representation of the dams |
label |
character vector of labels |
verbose |
logical to print the row of the pedigree that the function is ordering. Default is FALSE. |
Value
a data frame with the pedigree ordered.
Examples
ped <- data.frame(sire=as.character(c(NA,NA,NA,NA,NA,1,3,5,6,4,8,1,10,8)),
dam=as.character(c(NA,NA,NA,NA,NA,2,2,NA,7,7,NA,9,9,13)),
label=as.character(1:14))
ped <- ped[sample(replace=FALSE, 1:14),]
ped <- editPed(sire = ped$sire, dam = ped$dam, label = ped$label)
ped <- with(ped, pedigree(label = label, sire = sire, dam = dam))
[Package pedigreeTools version 0.2 Index]