Learn R Programming

pedigreeTools (version 0.2)

inbreeding: 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)

Value

the inbreeding coefficients as a numeric vector

Arguments

ped

pedigree

Examples

Run this code
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))

Run the code above in your browser using DataLab