[R] disabling NA token as na.string in read.table

Vadim Ogranovich vograno at arbitrade.com
Thu Dec 19 20:57:07 CET 2002


Dear R-Users,

I have a csv file that has NA tokens and these tokens are perfectly good
values that need not to be converted to NA by read.table(). I tried to
prevent the conversion by specifying the na.strings arg., but this seems to
only add to the list of NA strings, not substitute.

> system("cat foo")
system("cat foo")
1 foo
2 NA
> read.table("foo", na.strings="foo")
read.table("foo", na.strings="foo")
  V1 V2
1  1 NA
2  2 NA


This is R1.6.0 on Linux.

What did I do wrong?

Thanks, Vadim

-------------------------------------------------- 
DISCLAIMER \ This e-mail, and any attachments thereto, is intend ... [[dropped]]




More information about the R-help mailing list