Learn R Programming

AHMbook (version 0.2.5)

ch2marray: Converts capture-histories to an m-array

Description

Converts capture-histories to an m-array for use in a Cormack-Jolly-Seber (CJS) model.

Usage

ch2marray(CH)

Arguments

CH

An individuals x time matrix of capture records, 1 if captured, 0 otherwise, no missing values.

Value

An m-array, a (years-1) x years matrix, where element [i, j] contains the number of individuals released in year i and recaptured in year j+1 (by definition no recaptures can occur in year 1). The last column contains the number of individuals released in year i and never recaptured.

References

K<U+00E9>ry and Schaub (2012) Bayesian population analysis using WinBUGS - a hierarchical perspective, Academic Press.

K<U+00E9>ry, M. & Royle, J.A. (2021) Applied Hierarchical Modeling in Ecology AHM2 - 3.4.1

Examples

Run this code
# NOT RUN {
data(willowWarbler)
ch <- as.matrix(willowWarbler$birds[ , 1:11]) # extract capture-histories.
dim(ch)
ch2marray(ch)
# }

Run the code above in your browser using DataLab