search for: posix_ct_

Displaying 1 result from an estimated 1 matches for "posix_ct_".

2011 Mar 25
2
Preserving the class of POSIXt objects
...in some cases: foo <- as.POSIXct("2011-03-25 21:03:20")+1:10 length(foo) ## obviously 10 length(trunc(foo, "day")) # 1! This makes it impossible to use [ and length() with trunc'ed POSIXct vectors (and it is a little unexpected too that the result of using trunc with a POSIX_ct_ object is a POSIX_lt_ object) but the cure seems easy: in the code of [.POSIXt, ## old ## new x$sec <- 0 ## x$sec[] <- 0 x$min <- 0L ## x$min[] <- 0L x$hour <- 0L ## x$hour[] <- 0L After these changes,...