I am puzzled by the fact that NA apparently test true for any logical
condition. For example:
> y <- c(-1,0,1,NA)
> y[y>0]
[1] 1 NA
> y[y<=0]
[1] -1 0 NA
I would have expected that NA should fail all logical tests. Can anyone
explain this weird behaviour? Is there an option that controls it, or do I
always have to eliminate NAs manually?
I am using S-Plus 6.2 on Windows. Thank you,
Eva Goldwater email: goldwater@schoolph.umass.edu
Biostatistics Consulting Phone: (413) 545-2949
418 Arnold House Fax: (413) 545-1645
715 North Pleasant Street
University of Massachusetts
Amherst, MA 01003-9304
|