I'm looking for the cleanest way to implement the following.
vars <- c("f1", "f2", "f3")
list(data$f1, data$f2, data$f3)
Where instead I make the list by using each string in vars instead of hardcoding the data$f1, data$f2, ...
It can be solved easily using a for loop to create the list but is there a one-liner/lapply way to solve it?