[R] do.call and applying na.rm=TRUE

Jonathan Daily biomathjdaily at gmail.com
Thu May 12 20:01:56 CEST 2011


?do.call

Second argument is a list of arguments to pass. Try do.call(mean,
list(x, na.rm = T))

On Thu, May 12, 2011 at 1:57 PM, John Kerpel <john.kerpel at gmail.com> wrote:
> Hi all!  I need to do something really simple using do.call.
>
> If I want to call the mean function inside do.call, how do I apply the
> condition na.rm=TRUE?
>
> So, I use do.call(mean, list(x)) where x is my data.  This works fine if
> there are no NAs.
>
> Thanks,
>
> John
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



-- 
===============================================
Jon Daily
Technician
===============================================
#!/usr/bin/env outside
# It's great, trust me.



More information about the R-help mailing list