Re: [R] mean

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Fri, 06 Jun 2008 14:14:49 -0500

See also

?rowMeans

On Fri, Jun 6, 2008 at 1:56 PM, <ctu_at_bigred.unl.edu> wrote:
>> 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.
>>
>
> ______________________________________________
> 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.
>



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. Received on Fri 06 Jun 2008 - 20:12:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Jun 2008 - 20:31:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive