#is this what you want? t <- matrix(rnorm(120), ncol=12) (colnames(t) <- paste(rep(LETTERS[1:4], each=3), 1:3, sep=".")) f<-as.matrix(cbind(c(t[,1:3]), c(t[,4:6]), c(t[7:9]), c(t[10:12]))) colnames(f)<-paste(rep(LETTERS[1:4])) library(prettyR) describe(f, num.desc=c("mean", "sd"))
On Wed, Jun 18, 2008 at 10:17 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > 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@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. > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[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.