[R] What's wrong with MEAN?

Liviu Andronic landronimirc at gmail.com
Tue May 22 11:29:32 CEST 2012


On Tue, May 22, 2012 at 11:22 AM, Vincy Pyne <vincy_pyne at yahoo.ca> wrote:
> Thanks a lot for pointing out such a silly mistake from my side. I was simply wondering how come I am not getting such a simple mean.
>
To avoid such mistakes it would help to first store your data in a vector.

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

If you did otherwise:
> x<- 16,18
Error: unexpected ',' in "x<- 16,"

then R would complain.

Liviu



More information about the R-help mailing list