This function appends one or more covariate names to all elements (i.e., covariate sets)
in a list of character vectors. This is useful when a covariate (like a confounder or
control variable) needs to be included in every model. It also works with a single
character vector input. The resulting list
can be input into the covariates argument in write_inla_formulas.
Usage
cov_add(covariates, name, add = FALSE)
Value
A list of character vectors, with each vector containing the original covariates
plus the additional ones specified in the name argument.
Arguments
covariates
A character vector or a list of character vectors, where each vector
represents a set of covariates (e.g., from cov_multi).
name
A character vector of covariate names to be added to each set.
add
Boolean that indicates if the original combinations in the covariates
argument must be kept. Defaults to FALSE.