I have a data.table like this
dput(DT) structure(list(ref = c(3L, 3L, 3L, 3L), nb = 12:15, i1 = c(3.1e-05, 0.044495, 0.82244, 0.322291), i2 = c(0.000183, 0.1
The dplyr solution would be to use mutate_ together with paste(listCol, collapse = "+"). But I guess the Reduce solution is faster.
dplyr
mutate_
paste(listCol, collapse = "+")
Reduce
DT <- mutate_(DT, sum = paste(listCol, collapse = "+"))