[Rd] Characters subsetted with NA (was: Several R vs S-Plus issues)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
04 Oct 2001 17:45:32 +0200


David Brahm  <a215020@agate.fmr.com> writes:

>   R> is.na
>   .Primitive("is.na")
> so I don't know how to change it (I'm a lousy developer, you see).
> 
> I propose again that we provide options(na.char="NA"), so users can make their
> own choice.  Thanks for listening!

Other's have been on the warpath re. this issue lately (and it's been
an annoyance for years - NorAdrenalin, Nitric Acid, etc.). It's not
unlikely to find a solution for 1.4, but probably not the one you are
proposing. Basically, we should have a *real* NA for string variables,
distinct from the character string "NA" and propagating like any other
NA's.

Inserting a value to substitute for missing could be handled
differently, e.g. via

replace.na <- function(x,r){x[is.na(x)]<-r; x}

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._