Dear David and Rui, Thankyou very much. :D Eliza > From: dcarl...@tamu.edu > To: eliza_bo...@hotmail.com; r-help@r-project.org > Subject: RE: [R] average of rows of each column > Date: Fri, 4 Apr 2014 15:14:32 -0500 > > Something like (only 20 columns here): > > x <- matrix(rnorm(120*20), 120, 20) > xagg <- aggregate(x, list(rep(1:12, each=10)), mean) > > ------------------------------------- > David L Carlson > Department of Anthropology > Texas A&M University > College Station, TX 77840-4352 > > ----Original Message----- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of eliza botto > Sent: Friday, April 4, 2014 1:08 PM > To: r-help@r-project.org > Subject: [R] average of rows of each column > > > Dear useRs, > I have a matrix of 120 row and 1000 columns.What I want is to > get an average of a set of 12 rows starting from 1 till 120 for > each column. Precisely, for column 1 the average of 1:10 rows, > 11:20 rows.... 111:120. similarly for column 2, 3, 4.... 1000. > So in the end i should have a matrix with 12 rows and 1000 > columns. > Thankyou very much in advance. > > Eliza > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > [[alternative HTML version deleted]]
______________________________________________ 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.