function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

function

Bill Hunsicker

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
[hidden email]
336-678-5260(w)
336-207-3895(m)
336-678-5088(lab)
610-298-2988(h)

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: function

jholtman
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 <[hidden email]> 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
> [hidden email]
> 336-678-5260(w)
> 336-207-3895(m)
> 336-678-5088(lab)
> 610-298-2988(h)
>
> ______________________________________________
> [hidden email] 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?

______________________________________________
[hidden email] 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.