I've updated dplyr (now 0.7.1) and a lot of my old code does not work because mutate_each has been deprecated. I use to do something like this (code below) with mutate_each using the column index. I'd do this on hundreds of columns. And I just can't figure out how to use the vars argument correctly with mutate_at. All examples I've seen have been using column names...which I don't want to do. I'm sure it's a simple answer but I've spent too much time trying to figure it out and would appreciate some help very much.
data<-data.frame(numbers=1:10, morenumbers=11:20)
change<-function(x) ifelse(x>10, 1, 2)
newdata<-data%>%mutate_each(funs(change), 1:2)
If I try:
newdata<-data%>%mutate_at(funs(change), vars(1:2))
Or even this:
newdata<-data%>%mutate_at(funs(change), vars(numbers, morenumbers))
I get the following error
Error: `.vars` must be a character/numeric vector or a `vars()` object,
not list