# Original pedigree file in Gulisija & Crow (2007)
pedigree <- tibble::tibble(
id = c("M", "K", "J", "a", "c", "b", "e", "d", "I"),
dam = c("0", "0", "0", "K", "M", "a", "c", "c", "e"),
sire = c("0", "0", "0", "J", "a", "J", "b", "b", "d")
)
pedigree <- purgeR::ped_rename(pedigree, keep_names = TRUE)
# Partial inbreeding relative to founder ancestors
m <- ip_Fij(pedigree)
# Note that in the example above, the sum of the values in
# rows will equal the vector of inbreeding coefficients
# i.e. base::rowSums(m) equals purgeR::ip_F(pedigree)$Fi
# Compute partial inbreeding relative to an arbitrary ancestor
# with id = 3 (i.e. individual named "J")
anc <- as.integer(c(3))
m <- ip_Fij(pedigree, mode = "custom", ancestors = anc)
Run the code above in your browser using DataLab