This function pools together individuals with the same encounter capture-recapture history.

group_data(X, effX)

Arguments

X

matrix of capture-recapture histories

effX

vector with numbers of individuals with that particular capture-recapture history

Value

matrix with grouped capture-recapture histories and counts in the last column

Author

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

Examples

# Generate fake capture-recapture dataset X = matrix(round(runif(300)),nrow=100) freq=rep(1,100) cbind(X,freq)
#> freq #> [1,] 0 1 0 1 #> [2,] 1 1 1 1 #> [3,] 1 0 0 1 #> [4,] 0 0 0 1 #> [5,] 0 0 0 1 #> [6,] 0 1 1 1 #> [7,] 0 1 0 1 #> [8,] 0 1 0 1 #> [9,] 1 1 0 1 #> [10,] 1 1 1 1 #> [11,] 1 1 0 1 #> [12,] 0 1 1 1 #> [13,] 0 0 0 1 #> [14,] 0 1 1 1 #> [15,] 0 1 0 1 #> [16,] 0 1 1 1 #> [17,] 0 0 1 1 #> [18,] 0 1 1 1 #> [19,] 0 1 1 1 #> [20,] 1 1 1 1 #> [21,] 0 1 0 1 #> [22,] 1 1 0 1 #> [23,] 1 0 0 1 #> [24,] 0 1 1 1 #> [25,] 1 1 1 1 #> [26,] 1 0 1 1 #> [27,] 0 0 0 1 #> [28,] 1 1 1 1 #> [29,] 1 0 1 1 #> [30,] 1 0 1 1 #> [31,] 0 0 1 1 #> [32,] 0 1 0 1 #> [33,] 0 1 1 1 #> [34,] 1 1 0 1 #> [35,] 0 1 0 1 #> [36,] 0 1 1 1 #> [37,] 1 1 1 1 #> [38,] 1 0 0 1 #> [39,] 0 0 1 1 #> [40,] 0 1 1 1 #> [41,] 1 0 1 1 #> [42,] 0 1 0 1 #> [43,] 1 1 1 1 #> [44,] 1 0 0 1 #> [45,] 0 1 1 1 #> [46,] 1 0 1 1 #> [47,] 1 1 1 1 #> [48,] 1 0 1 1 #> [49,] 1 1 1 1 #> [50,] 0 1 0 1 #> [51,] 0 1 1 1 #> [52,] 0 0 0 1 #> [53,] 0 1 1 1 #> [54,] 1 0 1 1 #> [55,] 0 0 0 1 #> [56,] 1 0 1 1 #> [57,] 0 1 0 1 #> [58,] 1 0 0 1 #> [59,] 0 0 1 1 #> [60,] 0 1 0 1 #> [61,] 1 1 0 1 #> [62,] 0 1 1 1 #> [63,] 1 1 1 1 #> [64,] 0 1 1 1 #> [65,] 1 1 1 1 #> [66,] 0 1 1 1 #> [67,] 1 1 0 1 #> [68,] 1 0 0 1 #> [69,] 1 0 0 1 #> [70,] 0 1 1 1 #> [71,] 0 1 1 1 #> [72,] 0 0 1 1 #> [73,] 0 0 0 1 #> [74,] 0 1 1 1 #> [75,] 0 0 0 1 #> [76,] 0 1 1 1 #> [77,] 0 1 1 1 #> [78,] 1 0 0 1 #> [79,] 1 0 1 1 #> [80,] 0 1 1 1 #> [81,] 1 1 0 1 #> [82,] 1 0 1 1 #> [83,] 0 1 0 1 #> [84,] 0 0 0 1 #> [85,] 0 1 1 1 #> [86,] 1 0 0 1 #> [87,] 0 0 1 1 #> [88,] 0 0 1 1 #> [89,] 1 1 1 1 #> [90,] 0 0 1 1 #> [91,] 1 1 1 1 #> [92,] 0 0 0 1 #> [93,] 1 0 0 1 #> [94,] 1 1 0 1 #> [95,] 1 1 1 1 #> [96,] 0 0 0 1 #> [97,] 1 1 0 1 #> [98,] 1 1 0 1 #> [99,] 0 0 1 1 #> [100,] 0 1 0 1
group_data(X,freq)
#> effY #> [1,] 0 0 0 11 #> [2,] 0 0 1 9 #> [3,] 0 1 0 13 #> [4,] 0 1 1 23 #> [5,] 1 0 0 10 #> [6,] 1 0 1 10 #> [7,] 1 1 0 10 #> [8,] 1 1 1 14