Skip to content

how to calculate the average values of each row in a matrix

3 messages · Elaine Kuo, michael.weylandt at gmail.com (R. Michael Weylandt, Guibert TCHINDE

On Jul 19, 2013, at 20:19, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:

            
Perhaps the rowMeans() function?

MW
#
[,1] [,2] [,3]
[1,]    1    1   -1
[2,]    6    2   -1
[3,]    0    0    2
[4,]    0   -3   -2
[5,]    1    1    2
[1]  0.3333333  2.3333333  0.6666667 -1.6666667  1.3333333
[1]  0.3333333  2.3333333  0.6666667 -1.6666667  1.3333333

may be this helps

GT
________________________________________
De : r-help-bounces at r-project.org [r-help-bounces at r-project.org] de la part de R. Michael Weylandt <michael.weylandt at gmail.com> [michael.weylandt at gmail.com]
Date d'envoi : samedi 20 juillet 2013 03:33
? : Elaine Kuo
Cc : r-help at stat.math.ethz.ch
Objet : Re: [R] how to calculate the average values of each row in a matrix
On Jul 19, 2013, at 20:19, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:

            
Perhaps the rowMeans() function?

MW
______________________________________________
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.


Click https://www.mailcontrol.com/sr/0NMwdyLXvWXGX2PQPOmvUlvAwUAcTfZn4fkKLlvv9q+YH6kYUkFzXm6zZ2oqmDGRhRWtQ2HzzdeVGm43FW9a3A==  to report this email as spam.