[R] Problem with mean()

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sat Jul 21 18:44:40 CEST 2018


Read ?mean.

Look at the argument list.

The mean function only applies to the first argument.

On July 21, 2018 9:39:42 AM PDT, John Kane via R-help <r-help using r-project.org> wrote:
>Either I am doing something very stupid or my R installation has a
>glitch. What am I missing?
>dd1  <- 50
>dd2  <- 54
>
>mean(dd1, dd2)
>[1] 50  # wrong
>
>(dd1 + dd2)/2
>[1] 52 # correct
>
>aa  <- c(48, 52, 56, 54, 52)
>
>mean(aa)
>[1] 52.4 # correct
>
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

-- 
Sent from my phone. Please excuse my brevity.




More information about the R-help mailing list