Learn R Programming

nprcgenekeepr (version 1.0.5)

checkParentAge: Check parent ages to be at least minParentAge

Description

Ensure parents are sufficiently older than offspring

Usage

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

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab