[R] function

jim holtman jholtman at gmail.com
Wed Nov 7 21:58:28 CET 2007


Does this do what you want?

> x <- 1:10
> x.f <- function(dat){
+     c(mean=mean(dat), median=median(dat), sd=sd(dat))
+ }
> x.f(x)
    mean   median       sd
5.500000 5.500000 3.027650
>


On 11/7/07, Bill Hunsicker <BHunsicker at rfmd.com> wrote:
>
> Rhelp,
>
> I have a collection of data that I would like to perform some simple
> functions on like mean, stdev....  I would like to write a function that
> I sent data set to and have mean, and other calculations derived from
> data set returned.
>
> Can you help me?
>
> Regards,
> Bill
>
>
>
> Bill Hunsicker
> RF Micro Devices
> 7625 Thorndike Road
> Greensboro, NC 27409-9421
> bhunsicker at rfmd.com
> 336-678-5260(w)
> 336-207-3895(m)
> 336-678-5088(lab)
> 610-298-2988(h)
>
> ______________________________________________
> 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.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list