I have a large data table (from the package data.table) with over 60 columns (the first three corresponding to factors and the remaining to response variables, in this case
[ Edited 2020-02-15 to reflect current state of data.table ] In recent versions of data.table rowSums(Abundance[ , 4:6]) works as OP originally expected. Here are some alternatives:
Abundance[, SumAbundance := rowSums(.SD), .SDcols = 4:6]
Also, I didn't check, but I have a suspicion this will be faster, since it will not convert to matrix as rowSums does:
Abundance[, SumAbundance := Reduce(`+`, .SD), .SDcol = 4:6]