Skip to contents

Maps each supplied species name to a conservative upper bound on the number of days from conception to birth, using the speciesGestation lookup table (or a supplied gestationTable). Matching is case- and whitespace-insensitive. Any species that is missing, NA, an empty string, or not present in the table falls back to default (210 days, the conservative rhesus bound). Used by getPotentialParents to key its gestation window on the first-class species pedigree column.

Usage

getSpeciesGestation(species, gestationTable = NULL, default = 210L)

Arguments

species

character vector of species names (may contain NA).

gestationTable

optional data.frame with a character column species and an integer column gestation to use instead of the bundled speciesGestation table. Defaults to NULL, which uses the bundled table.

default

integer fallback returned for species that are missing, NA, empty, or not found in the table. Defaults to 210L.

Value

an integer vector of gestation-period day bounds, the same length and order as species.

Examples

getSpeciesGestation("RHESUS")
#> [1] 210
getSpeciesGestation(c("RHESUS", "UNICORN", NA))
#> [1] 210 210 210