[R] na.omit

buerkle@hawaii.edu
Mon, 17 Jul 2000 14:48:09 -0000

Why is it that when a vector contains no NAs, na.omit returns an empty
vector rather than the object/vector that was passed to it?

>na.omit(c(1,2,3,4))
numeric(0)

in contrast ...

>na.omit(c(1,2,3,NA))
[1] 1 2 3
attr(,"na.action")
[1] 4
attr(,"na.action")attr(,"class")
[1] "omit"

Thanks, Alex

---------------------------
platform i686-pc-linux-gnu
arch     i686
os       linux-gnu
system   i686, linux-gnu
status
major    1
minor    1.0
year     2000
month    June
day      15
language R