inbreeding: Inbreeding coefficients from a pedigree

View source: R/pedigree.R

inbreedingR Documentation

Inbreeding coefficients from a pedigree

Description

Create the inbreeding coefficients according to the algorithm given in "Comparison of four direct algorithms for computing inbreeding coefficients" by Mehdi Sargolzaei and Hiroaki Iwaisaki, Animal Science Journal (2005) 76, 401–406.

Usage

inbreeding(ped)

Arguments

ped

pedigree

Value

the inbreeding coefficients as a numeric vector

Examples

ped <- pedigree(sire = c(NA, NA, 1,  1, 4, 5),
                dam =  c(NA, NA, 2, NA, 3, 2),
                label = 1:6)
(F <- inbreeding(ped))

# Test for correctness
FExp <- c(0.000, 0.000, 0.000, 0.000, 0.125, 0.125)
stopifnot(!any(abs(F - FExp) > .Machine$double.eps))

pedigreeTools documentation built on Oct. 12, 2024, 9:07 a.m.