A summary of options suggested in the comments (and some others):
dd<-data.frame(
A= 1:3,
B= 2:4
)
You can get the sum of the columns with
dd$A + dd$B
rowSums(dd)
with(dd, A + B)
dd[,1]+ dd[,2]
dd[,"A"]+ dd[,"B"]
apply(dd, 1, sum)
do.call('+', dd)
Reduce("+",dd)
solved adding each element each row of two columns together in the same file without loops in R