Date: Fri, 16 Oct 1998 14:28:46 -0400 (EDT)
From: Ben Bolker <ben@eno.Princeton.EDU>
To: Bill Simpson <wsimpson@uwinnipeg.ca>
Subject: Re: [R] mean and sd of each serial position
In-Reply-To: <Pine.OSF.3.95.981016122938.5528A-100000@io.uwinnipeg.ca>
I think "apply" is what you're looking for ...
apply(rbind(a1,a2,a3),2,mean)
apply(rbind(a1,a2,a3),2,sd)
or making it into a function:
tmpf _ function(...) {
x _ rbind(...)
list(mean=apply(x,2,mean),sd=apply(x,2,sd))
}
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._