View source: R/erf_data_prep.R
erf_data_prep | R Documentation |
Prepares a data.frame object for use with the ERF (not needed if using erf())
A data.frame with a new first column of var as a binary factor (duplicated if duplicate=TRUE), the header and covariates columns, and a random variable column
erf_data_prep(
df = NULL,
var = NULL,
covariates = NULL,
header = NULL,
weights = NULL,
duplicate = TRUE,
mode = "bin"
)
df |
A data.frame object |
var |
A character string indicating the column name of the data frame that contains the number of interactions for the ERF to model; column should be a numeric column |
covariates |
A character vector indicating the column name(s) of the data frame that contain the covariates |
header |
A character vector indicating the column name(s) of the data frame that contain the additional columns you wish appended to the output |
weights |
a vector equal in length to nrow(df) of weights, NULL by default |
duplicate |
A logical flag that indicates whether to duplicate observations with more than one interaction. Default is TRUE to duplicate all records that interacted with more than one individual (i.e. a fishing set that caught two of the same species) |
data <- erf_data_prep(df = simData$samples, var = 'obs', covariates = grep('cov', colnames(simData$samples), value=TRUE), header = c('prob.raw','prob'))
head(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.