[R] Namibia becoming NA

Peter Dalgaard pdalgd at gmail.com
Sun Jul 18 11:21:03 CEST 2010


Berwin A Turlach wrote:

> Did you think of trying some variations of "na.strings"? ;-) 
> 
> IMO, the simplest way of coding missing values in CSV files is to have
> two consecutive commas; not some code (whether NA, 99, 999, -1, ...)
> between them.

Yes. Arguably, na.strings=NULL should be the default (and na="" for
write.csv) since delimited formats are (mainly) for communicating with
external programs, which are not likely to use the NA code (unless it is
for Namibia, North America, Noradrenalin, Niels Andersen, etc.)

However, back compatibility (including that with files written with R's
own write.csv) probably precludes changing anything at this point.
Notice that read.csv and friends do pass "..." to read.table, so it is
easy to override the default setting.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list