On 02/28/2011 09:07 PM, zbynek.jano...@gmail.com wrote:
I have found following problem:
I have a vector:
a<- c(1.04,1.04,1.05,1.04,1.04)
I want a mean of this vector:
mean(a)
[1] 1.042
which is correct, but:
mean(1.04,1.04,1.05,1.04,1.04)
[1] 1.04
gives an incorrect value.
how is this possible?

Hi Zbynek,

You're asking the function to give you the mean of a single value. Try this:

mean(c(1.04,1.04,1.05,1.04,1.04))

Jim

______________________________________________
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.

Reply via email to