checkParentAge: Check parent ages to be at least 'minParentAge'

Description Usage Arguments Value Examples

View source: R/checkParentAge.R

Description

Ensure parents are sufficiently older than offspring

Usage

1
checkParentAge(sb, minParentAge = 2, reportErrors = FALSE)

Arguments

sb

A dataframe containing a table of pedigree and demographic information.

minParentAge

numeric values to set the minimum age in years for an animal to have an offspring. Defaults to 2 years. The check is not performed for animals with missing birth dates.

reportErrors

logical value if TRUE will scan the entire file and make a list of all errors found. The errors will be returned in a list of list where each sublist is a type of error found.

Value

A dataframe containing rows for each animal where one or more parent was less than minParentAge. It contains all of the columns in the original sb dataframe with the following added columns:

  1. sireBirth sire's birth date

  2. sireAge age of sire in years on the date indicated by birth.

  3. damBirth dam's birth date damAge age of dam in years on the date indicated by birth.

Examples

1
2
3
4
5
6
7
library(nprcgenekeepr)
qcPed <- nprcgenekeepr::qcPed
checkParentAge(qcPed, minParentAge = 2)
checkParentAge(qcPed, minParentAge = 3)
checkParentAge(qcPed, minParentAge = 5)
checkParentAge(qcPed, minParentAge = 6)
checkParentAge(qcPed, minParentAge = 10)

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