[R] Help: "mean" and "replicate"

From: Alex99 <loyola9988_at_yahoo.com>
Date: Fri, 28 Nov 2008 08:51:21 -0800 (PST)

Hi all,

I used the "replicate" function to make 2 samples from file "test" with 5 records in each sample and saved the output in "result".

result=replicate(2,test[,sample(colnames(test),5,replace =FALSE)],simplify=FALSE)

now I need to calculate the mean of each cell; i.e. I need to add "the number in cell 1&1 from sample 1" and "the number in cell 1&1 in sample 2" and divide it by 2. and do the same for all numbers in two sample( adding the number in cell 1&2 from sample 1" and "the number in cell 1&2 in sample 2",.......)

does anyone have any idea how to do it?

Thanks

-- 
View this message in context: http://www.nabble.com/Help%3A-%22mean%22-and-%22replicate%22-tp20737544p20737544.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 Fri 28 Nov 2008 - 19:22:21 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 Fri 28 Nov 2008 - 19:30:51 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