Message-ID: <49F83FE1.8080603@bitwrit.com.au>
Date: 2009-04-29T11:54:09Z
From: Jim Lemon
Subject: reading csv file : blanks
In-Reply-To: <32fc2c8b0904290324n644f0401l12047bb34b456901@mail.gmail.com>
Nattu wrote:
> Hi,
>
> I have a comma seperated data file which has blanks in it. I am trinying to
> import it to R using
>
> data1<-read.csv("oa_2006.csv", header = TRUE, sep = ",", quote="\"",
> dec=".")
>
> I want the missing values to be "NA". instead R reads them as "U". Any idea
> why this happens ?
>
>
Hi Nataraju,
You have to explicitly specify the strings that you want to be read as
NA with the na.strings argument.
na.strings=""
if an empty string represents NA.
Jim