[R] computing the average and standard deviation for many sets of triplicates, using "R-approach"

From: Daren Tan <daren76_at_hotmail.com>
Date: Wed, 18 Jun 2008 14:17:54 +0000

Below example has 4 sets of triplicates, without using for loop and iteratively cbind the columns, what is the "R-approach" of generating a matrix of 8 columns that are the averages and standard deviations ? The average and standard deviation columns should be side by side i.e. A.mean A.sd B.mean B.sd C.mean C.sd D.mean D.sd  

> t <- matrix(rnorm(120), ncol=12)> (colnames(t) <- paste(rep(LETTERS[1:4], each=3), 1:3, sep=".")) [1] "A.1" "A.2" "A.3" "B.1" "B.2" "B.3" "C.1" "C.2" "C.3" "D.1" "D.2" "D.3"

[[elided Hotmail spam]]

        [[alternative HTML version deleted]]

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 Wed 18 Jun 2008 - 15:35:51 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 Wed 18 Jun 2008 - 18:30:50 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