[R] What's wrong with MEAN?

Rainer Schuermann rainer.schuermann at gmx.net
Tue May 22 11:18:24 CEST 2012


> mean( 16, 18 )
[1] 16
> mean( c( 16, 18 ) )
[1] 17



On Tuesday 22 May 2012 02:10:27 Vincy Pyne wrote:
> 
> Dear R helpers,
> 
> I have recently installed R version 2.15.0
> 
> I just wanted to calculate 
> 
> mean(16, 18)
> 
> Surprisingly I got answer as 
> 
> > mean(16, 18)
> [1] 16
> 
> 
> > mean(18, 16)
> 
> [1] 18
> 
> > mean(14, 11, 17, 9, 5, 18)
> [1] 14
> 
> 
> So instead of calculating simple Arithmetic average, mean command is generating first element as average. I restarted the machine, changed the machine, but still the reply is same. I have been using this mean function ever since I strated learning R, but this has never happened.
> 
> Kindly guide
> 
> Vincy
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.



More information about the R-help mailing list