extend
finds ascendants, which do not appear as
individuals in pedigree and assigns them as individuals with unknown
ascendants in extended pedigree.
extend(x, ascendant=NULL, col=NULL, top=TRUE)
Argument ascendant
can be used to define, which ascendants will
be extended. If ascendant=NULL
, which is the default, all
ascendant columns in the pedigree are used. The same approach is used
with other pedigree attributes such as sex, generation, etc. with
argument col
. Use col=NA
, if none of the pedigree
attributes should be extended.
Sex of new individuals is infered from attribute
ascendantSex
as used in Pedigree
function. Generation of
new individuals is infered as minimal
(generationOrder="increasing"
) or maximal
(generationOrder="decreasing"
) generation value in descendants -
1. See Pedigree
on this issue. Family values are extended
with means of family
.
Pedigree
, family
,
geneticGroups???# --- Toy example --- ped <- generatePedigree(nId=5, nGeneration=4, nFather=1, nMother=2) ped <- ped[10:20,] ped[5, "father"] <- NA # to test robustnes of extend on NA extend(ped) extend(ped, top=FALSE) ## Extend only ascendant and their generation extend(ped, col="generation") extend(ped, col=c("generation", "sex")) # --- Bigger example --- ped <- generatePedigree(nId=1000, nGeneration=10, nFather=100, nMother=500) nrow(ped) # Now keep some random individuals ped <- ped[unique(sort(round(runif(n=nrow(ped)/2, min=1, max=nrow(ped))))), ] nrow(ped) nrow(extend(ped))