I am trying to make something very simple and still can not determine the correct way to indicate. I just want to exclude some named columns from mutate_at. It works fine if I specify a position, but I don't want hard code positions.
For example, I want to get the same result as this:
mtcars %>% mutate_at(-c(1, 2), max)
But by specifying the column names mpgand cyl.
I have tried many things, including:
mtcars %>% mutate_at(-c('mpg', 'cyl'), max)
Is there a way to work with names and exceptions in mutate_at?
source
share