[R] mean calculations from a dframe column
David McPearson
dmcp at webmail.co.za
Mon Apr 14 14:19:21 CEST 2014
On Sun, 13 Apr 2014 05:01:40 -0700 (PDT) "andre.zacharia at gmail.com"
<andre.zacharia at gmail.com> wrote
> Thank you very much!!!!!!
>
..
..
> *De :* arun kirshna [via R]
> *Envoyé :* 13 avril 2014 11:23
> *À :* andre.zacharia at gmail.com
> *Objet :* Re: mean calculations from a dframe column
>
> Hi André,
>
> Your codes were missing in some information. If your code looks like this:
..
..
> Mean <- apply(a, 2, mean, na.rm = TRUE)
..
..
..
Andre,
Just for future reference, have a look at
?colMeans
"These functions are equivalent to use of apply with FUN = mean or FUN = sum
with appropriate margins, but are a lot faster."
Cheers,
D.
____________________________________________________________
South Africas premier free email service - www.webmail.co.za
Ensure Quality Health Care For All http://www.anc.org.za/2014/manifesto/
More information about the R-help
mailing list