Require usage of colSums(x) or rowSums(x) over apply(x, ., sum)
colSums(x)
rowSums(x)
apply(x, ., sum)
Useful links