Returns the subset of data containing only the columns named in vars,
in the order given. Replaces the Order_Variables() helper and the
Mod_Data <- dta[, Order_Var] pattern from
tp.dp.EDA_barplots_scatterplots_varnames.R.
Details
vars may be supplied as a character vector or as a single
space-separated string (matching the Var_CatList / Var_ContList style
from the template).
Examples
dta <- sample_eda_data()
# Vector form
sub <- eda_select_vars(dta, c("male", "cabg", "nyha"))
names(sub)
#> [1] "male" "cabg" "nyha"
# Space-separated string (matches template Var_CatList style)
sub2 <- eda_select_vars(dta, "male cabg nyha valve_morph")
names(sub2)
#> [1] "male" "cabg" "nyha" "valve_morph"