[R] 'mean' function

Martin Lam tmlammail at yahoo.com
Fri Sep 30 23:58:41 CEST 2005


Type "?mean" and hit "enter" in the console to see the
description of the function.

# randomly draw 5 numbers between 1 and 10 without
replacement
randomlist = sample(1:10, 5)
# calculate the mean of the list
meanoflist = mean(randomlist)
# show the result
meanoflist

HTH,

Martin

--- Lisa Wang <lisawang at uhnres.utoronto.ca> wrote:

> Hello,
> 
> Could you please let me know how to see the "mean"
> function in R  . The
> following is what I see when type in "mean" and
> "enter"
> 
> mean
> function (x, ...)
> UseMethod("mean")
> <environment: namespace:base>
> 
> I would like to see how the function is writen.
> 
> Thanks a lot
> 
> Lisa Wang
> Toronto, Ca
> 
> > This e-mail may contain confidential and/or
> privileged information for the sole use of the
> intended recipient. Any review or distribution by
> anyone other than the person for whom it was
> originally intended is strictly prohibited. If you
> have received this e-mail in error, please contact
> the sender and delete all copies. Opinions,
> conclusions or other information contained in this
> e-mail may not be that of the organization.>
______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list