This function allows the user to select variables from a data set by prefix
(using the pattern argument) or by exact name matching.
The return object is a character vector with the selected covariate names that can be used
as input for cov_add, cov_uni,
cov_multi, cov_interact, cov_nl,
and cov_varying functions.
Usage
extract_names(data = NULL, pattern = NULL, name = NULL)
Value
A character vector of matched covariate names.
Arguments
data
A data.frame containing the variables.
pattern
A character vector specifying prefix(es) to match (e.g., "tmin" matches "tmin", "tmin.l1", etc.).
name
A character vector of exact variable name(s) to extract.