r:tidyverse: How to change column data type using pipes with least typing
With typing reference to the column just once - the compliant answer is
mtcars %<>% mutate_at(6, as.integer)
To refer to column by name, solution with one redundant typing of column name is
mtcars %<>% mutate(qsec = as.integer(qsec))
NOTE:credit goes to commenting users above
This solution is probably the shortest:
mtcars$qsec %<>% as.integer
The trick is to perform the cast operation directly on the column > no need for mutate() any more.