[R] read.csv converts "NA" to missing values

R. Michael Weylandt michael.weylandt at gmail.com
Mon Feb 27 15:17:43 CET 2012


I believe read.csv(..., na.strings = "") will do it.

Michael

On Mon, Feb 27, 2012 at 8:15 AM, nikhil abhyankar <nsabhyankar at gmail.com> wrote:
> Hello,
>
> I have a CSV file with region codes listed in a column. E.g. 'AS' for Asia,
> 'AU' for Australia and 'NA' North America.
>
> However, the data frame created using read.csv shows <NA> where the string
> variable should have had the value 'NA'.
>
> How can I input the value 'NA' present in a column in a CSV file without R
> changing it to missing?
>
> Thanks
>
> Nikhil
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list