TABLE<-matrix(data=c(12,13,14,15,24,10),byrow=T,nrow=2,ncol=3)
TABLE
     [,1] [,2] [,3]
[1,]   12   13   14
[2,]   15   24   10
apply(TABLE,1,mean)
[1] 13.00000 16.33333

Chunhao


Quoting Marco Chiapello <[EMAIL PROTECTED]>:

Hi,
I have a simple question. If I have a table and I want to have the mean
for each row, how can I do?!
Es:
        c1      c2      c3      mean
1       12      13      14      ??
2       15      24      10      ??
...

Thanks,
Marco

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to