[R] NaN - trouble fixing NaN

R. Michael Weylandt michael.weylandt at gmail.com
Mon Apr 2 15:18:37 CEST 2012


Without seeing data, it's only a guess, but you should pass na.rm =
TRUE to mean() so it will pass over NaNs in the data :

tapply(HSuccess, Aeventexhumed, mean, na.rm=TRUE)

Cheers,
Michael

On Sun, Apr 1, 2012 at 7:27 PM, Jhope <jeanwaijang at gmail.com> wrote:
> Hi R-listers,
>
> I am using the package plyr. I am just trying to get the hatching success
> mean of each nesting event and have typed in the following and received the
> below results:
>
>> tapply(HSuccess, Aeventexhumed, mean)
>        A                    B                  C
> 0.2156265 0.1288559       NaN
>
> What can I do about NaN? I should be able to get a result for event C
> because I was able to make a boxplot graph with this information showing all
> three nesting events (A, B, and C).
>
> Please advise,
>
> Jean
>
> --
> View this message in context: http://r.789695.n4.nabble.com/NaN-trouble-fixing-NaN-tp4524713p4524713.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.



More information about the R-help mailing list