Learn R Programming

R2ucare (version 1.0.2)

multimarray: Multistate m-array

Description

This function calculates the m-array for multistate capture-recapture data, the number of released and never seen again individuals.

Usage

multimarray(X, freq)

Value

This function returns a matrix in which R the number of released individuals is in the first column, the number of individuals never recaptured (K-1) is in the last column and m the m-array (K-1 x K-1) with upper triangle filled only is in sandwich between these two vectors.

Arguments

X

a matrix of encounter histories over K occasions

freq

is a vector with the number of individuals having the corresponding encounter history

Author

Olivier Gimenez <olivier.gimenez@cefe.cnrs.fr>,Jean-Dominique Lebreton, Rémi Choquet, Roger Pradel

Examples

Run this code
# Read in Geese dataset:
geese = system.file("extdata", "geese.inp", package = "R2ucare")
geese = read_inp(geese)

# Get encounter histories and number of individuals with corresponding histories
geese.hist = geese$encounter_histories
geese.freq = geese$sample_size

# build m-array
multimarray(geese.hist, geese.freq)

Run the code above in your browser using DataLab