This function creates a matrix of covariates or design matrix appropriate for BaSTA from raw individual level covariate data. The function identifies categorical and continuous covariates and organizes them accordingly.
A character string vector or a numerical vector indicating the columns to be included or an object of class
A data frame of n rows (n = number of individuals in dataset) and nz columns (number of general covariates) including categorical covariates as factors (e.g. sex with individual labels "f","m", location, etc.) and/or continuous individual covariates (e.g. weight at birth, general weather conditions at each location, etc.).
x argument can be of class
formula as long as the elements described correspond to the column names in the
data data frame.
The data frame specified in argument
data needs to explicitly differentiate between categorical and numerical variables. The elements in the column of a categorical variable must be coerced to be
The function returns a new covariate matrix to be collated to a matrix that includes a column for individual ID, a column for time of birth, and a column for times of death, plus the full recapture matrix.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.