Re: [R] as.Date() results depend on order of data within vector?

From: Mark Wardle <mark_at_wardle.org>
Date: Sun 07 Jan 2007 - 13:11:38 GMT

Prof Brian Ripley wrote:

> The correct work-around is to get non-valid strings returned as NA, not
> "". That is argument 'na.strings' in RODBC (and elsewhere: read.table
> behaves in the same way).
>

Thanks for these replies.

As I have mentioned before, my peculiar combination of PostgreSQL, Actual's ODBC driver on Mac OS X, and RODBC means that for numbers and dates, NULL values are passed to R as empty strings rather than NAs (2). This does not occur with PostgreSQL's "text" column type.

For the benefit of others who in the future may use this combination(1), my workaround for numbers/integers/boolean values is to essentially have temporary intermediate tables with columns of type "text" whatever the format, and let R/RODBC parse the strings into the correct resulting format (which it then does faultlessly). This does not work for dates however, and so I must use one of the two workarounds I mentioned in my post.

Best wishes,

Mark

(1) unlikely as it may be
(2) I still cannot fathom why integers and dates are not handled correctly.



R-help@stat.math.ethz.ch 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. Received on Mon Jan 08 05:53:49 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 07 Jan 2007 - 19:31:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.