R/ungroup_data.R
ungroup_data.Rd
This function splits encounter histories in as many individual histories as required.
ungroup_data(X, effX)
X | matrix of encounter capture-recapture histories |
---|---|
effX | vector with numbers of individuals with that particular encounter history |
matrix with ungrouped capture-recapture histories and counts in the last column (should be 1s)
Olivier Gimenez <olivier.gimenez@cefe.cnrs.fr>, Roger Pradel, Rémi Choquet
# Generate fake capture-recapture dataset X = matrix(round(runif(9)),nrow=3) freq=c(4,3,-8) cbind(X,freq)#> freq #> [1,] 1 1 0 4 #> [2,] 0 0 0 3 #> [3,] 1 0 1 -8ungroup_data(X,freq)#> [,1] [,2] [,3] [,4] #> [1,] 1 1 0 1 #> [2,] 1 1 0 1 #> [3,] 1 1 0 1 #> [4,] 1 1 0 1 #> [5,] 0 0 0 1 #> [6,] 0 0 0 1 #> [7,] 0 0 0 1 #> [8,] 1 0 1 -1 #> [9,] 1 0 1 -1 #> [10,] 1 0 1 -1 #> [11,] 1 0 1 -1 #> [12,] 1 0 1 -1 #> [13,] 1 0 1 -1 #> [14,] 1 0 1 -1 #> [15,] 1 0 1 -1