[R] Problem with lubridate and decimal seconds

Agustin Lobo aloboaleu at gmail.com
Sun Jun 23 12:51:57 CEST 2013


I get lubridate objects with the same decimal seconds while they are
different in the input char:

require(lubridate)
options("digits.secs"=3)
options("digits.secs")
$digits.secs
[1] 3

dias <- c("140613","140613")
moment <- c("100545.5", "100545.6")
paste(dias,moment)
[1] "140613 100545.5" "140613 100545.6"

but
dmy_hms(paste(dias,moment))
[1] "2013-06-14 10:05:45.5 UTC" "2013-06-14 10:05:45.5 UTC"

is this a bug?

Agus
PS
> sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] lubridate_1.3.0

loaded via a namespace (and not attached):
[1] digest_0.6.3  memoise_0.1   plyr_1.8      stringr_0.6.2 tools_3.0.0


--
Agustin Lobo
aloboaleu at gmail.com



More information about the R-help mailing list