An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120227/d437d603/attachment.pl>
read.csv converts "NA" to missing values
3 messages · nikhil abhyankar, R. Michael Weylandt, Peter Dalgaard
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.
On Feb 27, 2012, at 14:15 , nikhil abhyankar 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?
I'd try na.strings="" (or maybe NULL or character(0)) -pd
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.
Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com