DiscreteCovariateNames {EpiForsk} | R Documentation |
Detect elements in covariates which match a string from the discrete_covariates argument.
DiscreteCovariateNames(covariates, discrete_covariates = NULL)
covariates |
character, names of covariates |
discrete_covariates |
character, names of discrete covariates. Currently
it is assumed that discrete covariates are one-hot encoded with naming in
covariates following |
A character vector with elements from covariates matching the names supplied in discrete_covariates.
KIJA
one_hot_df <- mtcars |>
dplyr::mutate(across(c(2, 8:11), factor)) |>
as.data.frame() |>
DiscreteCovariatesToOneHot(cyl)
EpiForsk:::DiscreteCovariateNames(colnames(one_hot_df), c("cyl"))