completeness | R Documentation |
Calculates completeness of the pedigree for individuals and for groups of individuals in each ancestral generation.
completeness(Pedig, keep=NULL, maxd=50, by="Indiv")
Pedig |
Data frame containing the pedigree, where the first columns are |
keep |
Vector with IDs of the individuals for which the completeness will be calculated, or a logical vector indicating the individuals. By default, all individuals are used. |
maxd |
Number of generations for which completeness should be calculated. |
by |
Name of a column in data frame |
The function computes the completeness of the pedigree for the specified individuals and for groups of individuals. It is the proportion of known ancestors in each generation. Generation 0 corresponds to the individual itself, so the completeness is always 1 in generation 0.
Data frame with the following columns
Indiv (or 'by') |
ID of the individual or level of the grouping factor, |
Generation |
Generation number, |
Completeness |
Completeness of the pedigree in the respective generation. |
Robin Wellmann
Cazes P, Cazes MH. (1996) Comment mesurer la profondeur genealogique d'une ascendance? Population (French Ed) 51:117-140.
Another function for characterizing pedigree completeness is summary.Pedig
.
#Computes the pedigree completeness of Hinterwald cattle
#born between 2006 and 2007 in each ancestral generation.
data(PedigWithErrors)
Pedig <- prePed(PedigWithErrors)
compl <- completeness(Pedig, keep=Pedig$Born %in% (2006:2007), maxd=50, by="Indiv")
head(compl)
#Summary statistics can be computed directly from the pedigree:
Summary <- summary(Pedig, keep=Pedig$Born %in% (2006:2007))
head(Summary)
hist(Summary$PCI, xlim=c(0,1), main="Pedigree Completeness")
hist(Summary$Inbreeding, xlim=c(0,1), main="Inbreeding")
hist(Summary$equiGen, xlim=c(0,20), main="Number of Equivalent Complete Generations")
hist(Summary$fullGen, xlim=c(0,20), main="Number of Fully Traced Generations")
hist(Summary$maxGen, xlim=c(0,20), main="Number of Maximum Generations Traced")
compl <- completeness(Pedig, keep=Pedig$Born %in% (2006:2007), maxd=50, by="Sex")
head(compl)
library("ggplot2")
ggplot(compl, aes(Generation, Completeness, col=Sex))+geom_line()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.