Please consider:
require(dplyr)
my_data <-
data.frame(a.x = sample(1100),
b.x = sample(1100),
a.y = sample(1100),
b.x = sample(1100))
my_data %>%
mutate(a = a.x + a.y,
b = b.x + b.y)
Is it possible to pass functions on sets of columns based on their common prefix with dplyr::mutate_at
.vars
and .funs
?