[R] Feature request for as.Date() function

nabble.30.miller_2555 at spamgourmet.com nabble.30.miller_2555 at spamgourmet.com
Wed Nov 25 18:38:44 CET 2009


Hello -

I have a csv file with a few date columns. Some of the records have an
"NA" character string instead of the date. When I attempt to use
read.csv() and typecast the columns using colClasses, I receive the
following error:
    Error in charToDate(x) :
      character string is not in a standard unambiguous format

Similarly, the following command produces the same error:
    as.Date("NA")

However, as.Date(NA) performs as documented.

Can we enhance the as.Date() function to convert "NA" strings into NA
value prior to type conversion?

Thanks!




More information about the R-help mailing list