[R] What's wrong with MEAN?

Jim Holtman jholtman at gmail.com
Tue May 22 11:22:02 CEST 2012


you need to provide a vector:

mean(c(16,18))

Sent from my iPad

On May 22, 2012, at 5:10, Vincy Pyne <vincy_pyne at yahoo.ca> 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