Re: [R] Namibia becoming NA

2010-07-18 Thread Peter Dalgaard
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 d

Re: [R] Namibia becoming NA

2010-07-18 Thread Berwin A Turlach
G'day Ted, On Sun, 18 Jul 2010 09:25:09 +0100 (BST) (Ted Harding) wrote: > On 18-Jul-10 05:47:03, Suresh Singh wrote: > > I have a data file in which one of the columns is country code and > > NA is the > > code for Namibia. > > When I read the data file using read.csv, NA for Namibia is being >

Re: [R] Namibia becoming NA

2010-07-18 Thread Ted Harding
On 18-Jul-10 05:47:03, Suresh Singh wrote: > I have a data file in which one of the columns is country code and NA > is the > code for Namibia. > When I read the data file using read.csv, NA for Namibia is being > treated as > null or "NA" > > How can I prevent this from happening? > > I tried th

Re: [R] Namibia becoming NA

2010-07-17 Thread Joshua Wiley
Hi Suresh, I think you will need to use read.table() rather than the read.csv() wrapper for it. Try: input <- read.table(file = "padded.csv", sep = ",", header = TRUE, na.strings = NULL) HTH, Josh On Sat, Jul 17, 2010 at 10:47 PM, Suresh Singh wrote: > I have a data file in which one of the

[R] Namibia becoming NA

2010-07-17 Thread Suresh Singh
I have a data file in which one of the columns is country code and NA is the code for Namibia. When I read the data file using read.csv, NA for Namibia is being treated as null or "NA" How can I prevent this from happening? I tried the following but it didn't work input <- read.csv("padded.csv",h