powered by
############################################################################ Function to keep only certain variables
keep_required_columns(variables, the_data)
subset
list of variables
data to be sub setting
the_data <- data.frame("Age" = c(21, 15), "sex" = c("m", "f")) variable <- "Age" keep_required_columns(variable, the_data)
Run the code above in your browser using DataLab