createAge | R Documentation |
Creates an animals x intervals matrix which gives the age class for each individual at the beginning of each interval, based on the occasion of first capture and the age at first capture.
createAge(f, age, nyears, mAge=2)
f |
a vector of first capture occasions. |
age |
a corresponding vector with the age at first capture of each animal. |
nyears |
the number of years of the study; the number of intervals is |
mAge |
the maximum age class; age is incremented by 1 each year up to |
An individuals x intervals matrix with the age of each individual at the beginning of each interval. Cells prior to the first capture are filled with NAs.
Michael Schaub
Schaub, M., Kéry, M. (2022) Integrated Population Models, Adademic Press, section 4.5.1.1.
data(woodchat5)
f <- getFirst(woodchat5$ch)
# Remove animals first captured on the last occasion
last <- which(f==ncol(woodchat5$ch))
f <- f[-last]
age <- woodchat5$age[-last]
x <- createAge(f, age, 20, 2)
head(x)
x[115:120,]
tail(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.