[R] Date bug?

natalia norden norden at cict.fr
Tue Apr 4 10:50:26 CEST 2006


Hello,

I have problems using the functions as.Date and strptime/strftime of 
base package and some functions of package zoo in my computer (Apple, 
Mac OS X 10.3.9).

When I use them, the R application closes... However, it depends on the 
length of the vector I want to transform.

For example, in the data.frame:

climat[c(1:5,1460:1462),]

          date TEMP_STG PRECIP_STG
1    01/01/01    24.51        0.6
2    02/01/01    24.51        1.2
3    03/01/01    24.51       27.1
4    04/01/01    24.32       36.9
5    05/01/01    24.12       22.2
1460 30/12/04    25.32        0.0
1461 31/12/04    25.76        1.0
1462 01/01/05    25.88        0.0

class(climat$date) character

If I do:

date=strptime(climat$date,format="%d/%m/%y") then R closes.

However if I do=

d=strptime(climat$date[1:5],format="%d/%m/%y") and then
date=strptime(climat$date,format="%d/%m/%y") it works!

(idem with functions as.Date, as.yearmon, etc..)

I already re-downloaded R but it still doesn't work.
Has this bug been reported?
How can I overcome this problem?
Thank you very much for any help!

Natalia Norden

Natalia Norden  PhD student
Laboratoire Evolution et Diversité Biologique
Bat 4R3 Université Paul Sabatier Toulouse III
118, route de Narbonne, 31062 Toulouse Cedex 9




More information about the R-help mailing list