R/getPedMaxAge.R

Defines functions getPedMaxAge

Documented in getPedMaxAge

#' Get the maximum age of live animals in the pedigree.
#'
## Copyright(c) 2017-2024 R. Mark Sharp
## This file is part of nprcgenekeepr
#'
#' @return Numeric value representing the maximum age of animals in the
#' pedigree.
#'
#' @param ped dataframe with pedigree
#' @export
#' @examples
#' library(nprcgenekeepr)
#' examplePedigree <- nprcgenekeepr::examplePedigree
#' ped <- qcStudbook(examplePedigree,
#'   minParentAge = 2,
#'   reportChanges = FALSE,
#'   reportErrors = FALSE
#' )
#' getPedMaxAge(ped)
getPedMaxAge <- function(ped) {
  max(ped$age, na.rm = TRUE)
}

Try the nprcgenekeepr package in your browser

Any scripts or data that you put into this service are public.

nprcgenekeepr documentation built on June 8, 2025, 10:55 a.m.