| split_cap_hist {Petersen} | R Documentation | 
Split a vector of capture histories into a matrix with one column for each occasion
Description
Split a vector of capture histories into a matrix with one column for each occasion
Usage
split_cap_hist(cap_hist, sep = "", n = 2, prefix = "t", make.numeric = FALSE)
Arguments
| cap_hist | A vector of capture histories. | 
| sep | What separates the individual history values | 
| n | Number of sampling events in each history | 
| prefix | Prefix for labeling columns of matrix | 
| make.numeric | Change the expanded columns to numeric from character? | 
Details
@template data.cap_hist
Value
A matrix of capture histories with 1 column per sampling event
Examples
# standard 2 character capture histor
data(data_rodli)
Petersen::split_cap_hist(data_rodli$cap_hist)
# history vector with ".." separating the fields
test <- c("1..1","1..0")
split_cap_hist(test, sep=stringr::fixed(".."))
[Package Petersen version 2024.6.1 Index]