Message-ID: <20080606135639.r6hbgm31a8w8s4ko@wm-imp-2.unl.edu>
Date: 2008-06-06T18:56:39Z
From: ctu at bigred.unl.edu
Subject: mean
In-Reply-To: <1212767007.6257.6.camel@Biochimica2.bioveg.unito.it>
> 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 <marco.chiapello at unito.it>:
> 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 at 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.
>