Hi, there,
I have a similar problem. The chron example gives NA. dates doesn't work but
times does.
I would appreciate it if there's a fix for it.
Thanks,
Helena
example(chron)
chron> dts <- dates(c("02/27/92", "02/27/92", "01/14/92",
chron+ "02/28/92", "02/01/92"))
chron> dts
[1] <NA> <NA> <NA> <NA> <NA>
chron> # [1] 02/27/92 02/27/92 01/14/92 02/28/92 02/01/92
chron> tms <- times(c("23:03:20", "22:29:56", "01:03:30",
chron+ "18:21:03", "16:56:26"))
chron> tms
[1] 23:03:20 22:29:56 01:03:30 18:21:03 16:56:26
chron> # [1] 23:03:20 22:29:56 01:03:30 18:21:03 16:56:26
chron> x <- chron(dates = dts, times = tms)
chron> x
[1] (NA NA) (NA NA) (NA NA) (NA NA) (NA NA)
chron> # [1] (02/27/92 23:03:19) (02/27/92 22:29:56) (01/14/92 01:03:30)
chron> # [4] (02/28/92 18:21:03) (02/01/92 16:56:26)
chron>
chron> # We can add or subtract scalars (representing days) to dates or
chron> # chron objects:
chron> c(dts[1], dts[1] + 10)
Error in y + ifelse(m > 2, 0, -1) :
non-numeric argument to binary operator
In addition: Warning message:
In matrix(unlist(lapply(dots, origin)), nrow = 3) :
data length [2] is not a sub-multiple or multiple of the number of rows
[3]