Re: [R] Output a table formatted with standard deviations below means

2011-03-19 Thread David Winsemius
On Mar 19, 2011, at 12:13 PM, Nathan Torrance wrote: Is it in bad form to double post to StackOverflow and R-help? Apologies if so. Here's my task: I've got a matrix of means like so means<-matrix(1:10,nrow=2) colnames(means)<-c("a","b","c","d","e") and a matrix of standard deviations like

Re: [R] Output a table formatted with standard deviations below means

2011-03-19 Thread Jorge Ivan Velez
Hi Nathan, Do not know a direct way, but the following seems to work: # data means <- matrix(1:10,nrow=2) sds <- matrix(seq(0.1,1,by=0.1),nrow=2) colnames(means) <- colnames(sds) <- c("a","b","c","d","e") # adding "( )" to the SDs sdsn <- t(apply(sds, 1, function(x) paste('(', x, ')', sep = ""))

[R] Output a table formatted with standard deviations below means

2011-03-19 Thread Nathan Torrance
Is it in bad form to double post to StackOverflow and R-help? Apologies if so. Here's my task: I've got a matrix of means like so means<-matrix(1:10,nrow=2) colnames(means)<-c("a","b","c","d","e") and a matrix of standard deviations like so sds<-matrix(seq(0.1,1,by=0.1),nrow=2) colnames(sds)<-c