[R] na.omit

Kjetil Kjernsmo kjetil.kjernsmo at astro.uio.no
Mon Jul 17 23:09:26 CEST 2000


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 


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list