powered by
Create indicators from data frame
helper_indicator( df, vars_indicators, mapvalues_from, mapvalues_to, make_factor = TRUE )
a data frame with new columns that are the indicators from vars_indicators, with the same names pasted with "_ind".
vars_indicators
"_ind"
a data frame
a character vector of the variables from df to create indicators for
df
vector to pass to plyr::mapvalues() argument from
plyr::mapvalues()
from
vector to pass to plyr::mapvalues() argument to
to
a logical indicating whether resulting indicators should be factors. Default is TRUE.
TRUE
helper_indicator(df = df_adults, vars_indicators = c("EF1", "EF2", "EF3"), mapvalues_from = 1:5, mapvalues_to = c(0,0,0,1,1))
Run the code above in your browser using DataLab