dplyr apply function to multiple columns