[R] na.omit

Kjetil Kjernsmo
Mon, 17 Jul 2000 21:09:26 -0000

On 17 Jul 2000, Douglas Bates wrote:

>buerkle at hawaii.edu writes:
>
>> 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)

I have been wondering about something that could be related (perhaps not),
whether it is a design choice or a bug. If you do:
> 1:numeric(0)
Error in 1:numeric(0) : NA/NaN argument
In some cases, it has seemed to me that it would have been sooo much more
convenient if it returned
numeric(0)
But of course, I have no clue as to what that would break.... :-)

Best,

Kjetil
--
Kjetil Kjernsmo
Graduate astronomy-student                    Problems worthy of attack
University of Oslo, Norway            Prove their worth by hitting back
E-mail: kjetikj at astro.uio.no                                - Piet Hein
Homepage <URL:http://www.astro.uio.no/~kjetikj/>
Webmaster at skepsis.no