Skip to content
Prev 118321 / 398498 Next

chron() question

Hi all,
I'm using chron and it seems to me that there is a strange behaviour
when constructing chronological objects.
An extract of my source data is:
[1] "22:22:00" "22:42:00" "23:02:00" "23:22:00" "23:42:00" "00:02:00"
 [7] "00:22:00" "00:42:00" "01:02:00" "01:22:00" "01:42:00"
[1] 2005 2005 2005 2005 2005 2006 2006 2006 2006 2006 2006
[1] 365 365 365 365 365   1   1   1   1   1   1

And if I use:
chron(dates.=tdr.dat$day,times.=tdr.hhmm,origin.=c(month=1,day=0,year=tdr.dat$year),format=c(dates="d/m/y",times="h:m:s"))
The result is:
[1] (31/12/05 22:22:00) (31/12/05 22:42:00) (31/12/05 23:02:00)
 [4] (31/12/05 23:22:00) (31/12/05 23:42:00) (01/01/05 00:02:00)
 [7] (01/01/05 00:22:00) (01/01/05 00:42:00) (01/01/05 01:02:00)
[10] (01/01/05 01:22:00) (01/01/05 01:42:00)

While it seems to me that, through the R recycling rule, it should
consider the year 2006 in the corresponding results. Isn't it so?

Wishes,
Javier