Home>

The problem is as the title

Here's a technique I can think of:

code
df<-as.data.frame (matrix (1:15, nrow = 5, ncol = 3)) #Create dataframe
sumCol<-list () # Put the sum of lines
for (i in 1: 3) {
 sumCol [i]<-0
 for (j in 1: 5) {
   sumCol [i]<-sumCol [i] + df [i, j]
 }
}

If i know an easier way, please.

r