# Example function
print_vnames <- function(...){
var_names <- args_to_char(...)
print(var_names)
}
print_vnames(age, sex, income, weight)
print_vnames("age", "sex", "income", "weight")
# You can also pass in a character vector, if you have stored variable names elsewhere
var_names <- c("age", "sex", "income", "weight")
print_vnames(var_names)
Run the code above in your browser using DataLab