This function calculates the m-array, the number of released and never seen again individuals; deals with more than 1 group

marray(X, freq)

Arguments

X

a matrix of encounter histories over K occasions

freq

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

Value

This function returns a list with R the number of released individuals (K-1 x g matrix), m the m-array (K-1 x K-1 x g array) with upper triangle filled only and never the number of individuals never recaptured (K-1 x g matrix).

Author

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

Examples

# read in the classical dipper dataset dipper = system.file("extdata", "ed.inp", package = "R2ucare") dipper = read_inp(dipper,group.df=data.frame(sex=c('Male','Female'))) # Get encounter histories, counts and groups: dip.hist = dipper$encounter_histories dip.freq = dipper$sample_size dip.group = dipper$groups # get female data mask = (dip.group == 'Female') dip.fem.hist = dip.hist[mask,] dip.fem.freq = dip.freq[mask] # get number of released individuals (R), # the m-array (m) and # the number of individuals never seen again (never) marray(dip.fem.hist,dip.fem.freq)
#> $R #> [,1] #> [1,] 10 #> [2,] 34 #> [3,] 41 #> [4,] 41 #> [5,] 43 #> [6,] 50 #> #> $m #> , , 1 #> #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 5 1 0 0 0 0 #> [2,] 0 13 1 0 0 0 #> [3,] 0 0 17 1 0 0 #> [4,] 0 0 0 23 1 1 #> [5,] 0 0 0 0 26 0 #> [6,] 0 0 0 0 0 24 #> #> #> $never #> [,1] #> [1,] 4 #> [2,] 20 #> [3,] 23 #> [4,] 16 #> [5,] 17 #> [6,] 26 #>