Learn R Programming

openCR (version 2.2.6)

age.matrix: Session-specific Ages

Description

A matrix showing the age of each animal at each secondary session (occasion).

Usage

age.matrix(capthist, initialage = 0, minimumage = 0, maximumage = 1, 
    collapse = FALSE, unborn = minimumage)

Value

Either a numeric matrix with dimensions (number of animals, number of secondary occasions) or if collapse = TRUE a character matrix with one column.

Arguments

capthist

single-session capthist object

initialage

numeric or character name of covariate with age at first detection (optional)

minimumage

integer minimum age

maximumage

integer maximum age

collapse

logical; if TRUE then values for each individual are collapsed as a string with no spaces

unborn

numeric code for age<0

Details

age.matrix is used by openCR.design for the predictors `age' and `Age'.

Computations use the intervals attribute of capthist, which may be non-integer.

Ages are inferred for occasions before first detection, back to the minimum age.

See Also

openCR.design

Examples

Run this code

age.matrix(join(ovenCH), maximumage = 2, collapse = TRUE)

Run the code above in your browser using DataLab