findOffspring: Finds the number of total offspring for each animal in the...

Description Usage Arguments Value Examples

View source: R/findOffspring.R

Description

Part of Genetic Value Analysis

Usage

1
findOffspring(probands, ped)

Arguments

probands

character vector of egos for which offspring should be counted and returned.

ped

the pedigree information in datatable format. Pedigree (req. fields: id, sire, dam, gen, population). This requires complete pedigree information.

Value

A named vector containing the offspring counts for each animal in probands. Rownames are set to the IDs from probands.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(nprcgenekeepr)
examplePedigree <- nprcgenekeepr::examplePedigree
breederPed <- qcStudbook(examplePedigree, minParentAge = 2,
                         reportChanges = FALSE,
                         reportErrors = FALSE)
focalAnimals <- breederPed$id[!(is.na(breederPed$sire) &
                                  is.na(breederPed$dam)) &
                                is.na(breederPed$exit)]
ped <- setPopulation(ped = breederPed, ids = focalAnimals)
trimmedPed <- trimPedigree(focalAnimals, breederPed)
probands <- ped$id[ped$population]
totalOffspring <- findOffspring(probands, ped)

rmsharp/nprcmanager documentation built on April 24, 2021, 3:13 p.m.