Learn R Programming

nprcgenekeepr (version 2.0.0)

getPyramidAgeDist: Get the age distribution for the pedigree

Description

Returns the pedigree with all animals, adding a status column describing each animal as ALIVE or DECEASED and a computed age column (age at exit for deceased animals). All animals are returned, not only living ones.

Usage

getPyramidAgeDist(ped = NULL)

Value

A pedigree with status column added, which describes the animal as ALIVE or DECEASED and a age column added, which has the animal's age in years or NA if it cannot be calculated. The exit column values have been remapped to valid dates or NA.

Arguments

ped

The pedigree information in data.frame format

Details

The lubridate package is used here because of the way the modern Gregorian calendar is constructed, there is no straightforward arithmetic method that produces a person’s age, stated according to common usage — common usage meaning that a person’s age should always be an integer that increases exactly on a birthday.

Examples

Run this code
library(nprcgenekeepr)
ped <- getPyramidAgeDist()

Run the code above in your browser using DataLab