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

2007-01-07 Thread Mark Wardle
Dear all, The as.Date() function appears to give different results depending on the order of the vector passed into it. d1 = c(1900-01-01, 2007-01-01,,2001-05-03) d2 = c(, 1900-01-01, 2007-01-01,2001-05-03) as.Date(d1) # gives correct results as.Date(d2) # fails with error (* see below)

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

2007-01-07 Thread Gavin Simpson
On Sun, 2007-01-07 at 12:01 +, Mark Wardle wrote: Dear all, The as.Date() function appears to give different results depending on the order of the vector passed into it. d1 = c(1900-01-01, 2007-01-01,,2001-05-03) d2 = c(, 1900-01-01, 2007-01-01,2001-05-03) as.Date(d1) # gives

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

2007-01-07 Thread Prof Brian Ripley
On Sun, 7 Jan 2007, Mark Wardle wrote: Dear all, The as.Date() function appears to give different results depending on the order of the vector passed into it. d1 = c(1900-01-01, 2007-01-01,,2001-05-03) d2 = c(, 1900-01-01, 2007-01-01,2001-05-03) as.Date(d1) # gives correct results

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

2007-01-07 Thread Mark Wardle
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,

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

2007-01-07 Thread Patrick Connolly
On Sun, 07-Jan-2007 at 12:01PM +, Mark Wardle wrote: | Dear all, | | The as.Date() function appears to give different results depending on | the order of the vector passed into it. | | d1 = c(1900-01-01, 2007-01-01,,2001-05-03) | d2 = c(, 1900-01-01, 2007-01-01,2001-05-03) | as.Date(d1) #