Split a capture history data.frame
Splits a data.frame into a matrix
a single-column data.frame of class character to split
Mark-recapture software often requires data in split form, with each value in its own matrix cell. Here is a function to split a data.frame into a matrix with each column representing a capture occassion and each row representing an individual's capture history
A matrix of 1's and 0's, a row for each individual.
1 2 3 4 5 6 7 8 9 10 11
#' set up variables to be used by Simulate.CH for ten individuals N = 10 x1 = rnorm(N) #' each trait is normally distributed #' Run Simulate.CH with a constant recapture probability chObj = Simulate.CH(surv.form = 1 + 0.15*x1, p.constant = 1, N = N) str(chObj) ch = chObj$ch #' grab our data.frame ch #' it isn't split Split.CH(ch) #' returns a matrix
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.