[Rd] Negative years with strptime?

2012-07-10 Thread Winston Chang
Is there a way to make as.Date() and strptime() process strings with negative years? It appears that Date objects can contain negative years and you can convert them to strings, but you can't convert them back to Date objects. x - as.Date(c(0001-01-24, 0500-01-24)) as.character(x) # 0001-01-24

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Rui Barradas
Hello, Is there a bug with negative dates? Just see: seq(as.Date(-01-01), length = 22, by = -1 year) [1] -01-01 000/-01-01 000.-01-01 000--01-01 000,-01-01 [6] 000+-01-01 000*-01-01 000)-01-01 000(-01-01 000'-01-01 [11] 00/0-01-01 00//-01-01 00/.-01-01 00/--01-01 00/,-01-01 [16]

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Jeffrey Ryan
?as.Date Why would pre years be handled correctly? The help file explicitly states that they likely will not. Note: The default formats follow the rules of the ISO 8601 international standard which expresses a day as ‘2001-02-03’. If the date string does not specify the

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Winston Chang
It looks different on my system (Mac, R 2.15.1) seq(as.Date(-01-01), length = 22, by = -1 year) [1] -01-01 -001-01-01 -002-01-01 -003-01-01 -004-01-01 [6] -005-01-01 -006-01-01 -007-01-01 -008-01-01 -009-01-01 [11] -010-01-01 -011-01-01 -012-01-01 -013-01-01 -014-01-01 [16] -015-01-01

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Rui Barradas
On my earlier post I forgot to mention the sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5]