I have 3 columns of numbers, and i want to find the mean of each separately, and then the mean of all of the means. ive tried: av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3)) av3daysB but it only gives me the mean of the first column (avr1) Any suggestions? Thanks, Emilija
Try this: av3daysB<- mean(c(mean(avr1), mean(avr2), mean(avr3))) On Wed, May 26, 2010 at 4:30 PM, <ecvetano@uwaterloo.ca> wrote:> I have 3 columns of numbers, and i want to find the mean of each > separately, and then the mean of all of the means. > ive tried: > > av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3)) > av3daysB > > but it only gives me the mean of the first column (avr1) > > Any suggestions? > Thanks, > Emilija > > ______________________________________________ > 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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
On May 26, 2010, at 3:30 PM, ecvetano at uwaterloo.ca wrote:> I have 3 columns of numbers, and i want to find the mean of each > separately, and then the mean of all of the means. > ive tried: > > av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3)) > av3daysBsapply(list(avr1, avr2, avr3), mean) mean(c(avr1, avr2, avr3))> > but it only gives me the mean of the first column (avr1) > > Any suggestions? > Thanks, > Emilija > > ______________________________________________ > 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.David Winsemius, MD West Hartford, CT