Learn R Programming

nadiv (version 2.18.0)

genAssign: Generation assignment

Description

Given a pedigree, the function assigns the generation number to which each individual belongs.

Usage

genAssign(pedigree, ...)

# S3 method for default genAssign(pedigree, ...)

# S3 method for numPed genAssign(pedigree, ...)

Value

A vector of values is returned. This vector is in the same order as the ID column of the pedigree.

Arguments

pedigree

A pedigree where the columns are ordered ID, Dam, Sire

...

Arguments to be passed to methods

Details

0 is the base population.

Migrants, or any individuals where both parents are unknown, are assigned to generation zero. If parents of an individual are from two different generations (e.g., dam = 0 and sire = 1), the individual is assigned to the generation following the greater of the two parents (e.g., 2 in this example).