How to Count the Number of Generations?
Wondering how to count the number of generations in a population? Knowing the pedigree depth is important in population studies. It can get more complex with overlapping generations, but the logic and process are simple. There are two ways to approach this: top-bottom and bottom-top, differing only in the direction of counting. Top-bottom approach Discard animals with both parents missing. Set parents that no longer appear in the pedigree (i.e., not in the first column) to missing. Count one generation. Repeat until no animals remain in the pedigree. Here’s the R code, assuming ped is a pedigree data frame with animal, sire, and dam columns, and missing parents are denoted as 0: ...