1

I have a large dataframe where some of the columns have NA as a result of taking the log of 0.

I have been doing various tests on the data (ANOVA, Tukey, Kruskal Wallis, Mann Whitney) but I couldn't figure out what is happening to the NA values.

Is R excluding those values completely?

Ren Zhang
  • 91
  • 1
  • 2
  • 7
  • 1
    Each test, especially those implemented in non-base packages, might do something different. Always best to read the documentation. It would also be helpful to include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample data and specific functions to confirm what's actually happening. – MrFlick Aug 04 '16 at 17:54

1 Answers1

5

Yes. The behavior of R regarding missing observations is given by

options("na.action")

which, by default, is

> options("na.action")
$na.action
[1] "na.omit"

So for many functions like the ones you mentioned, R only considers complete observations, i.e., lines with no NA.

Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107