Re: [R] apply

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Thu 07 Apr 2005 - 23:25:16 EST

On Apr 7, 2005, at 8:27 AM, malte wrote:

> Hi,
>
> simple question I guess:
>
> the following line works well:
>
> aveBehav=c(apply(sdata, 2, mean))
>
> However, I would like to pass an argument to the function mean, namely
> na.rm=TRUE
>

apply(sdata,2,function(x) {mean(x,na.rm=TRUE)})

Sean



R-help@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 Received on Thu Apr 07 23:33:26 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:03 EST