0

Saved an xts object in .RData file and then opened it again in another R instance. I lose the microsecond timestamp. I keep the same configs in both environments including digits.secs=6.

yum <- structure(c(262, 262, 262, 100, 100, 100, 120, 370, 370, 370, 367, 392), 
                 class = c("xts", "zoo"), 
                 .indexCLASS = c("POSIXct", "POSIXt"), 
                 tclass = c("POSIXct", "POSIXt"), 
                 .indexTZ = "UTC", tzone = "UTC", 
                 index = structure(c(1355821310.69496, 
                                    1355821310.73023, 1355821310.75223, 
                                    1355821310.8355, 1355821310.87186,
                                    1355821310.88684), 
                 tzone = "UTC", 
                 tclass = c("POSIXct", "POSIXt")), 
                 .Dim = c(6L, 2L), 
                 .Dimnames = list(NULL, c("SzX", "SzS")
                )
              )

Any pointers?

shoonya
  • 292
  • 1
  • 10
  • Saving the object in the question via `save`, then restarting R, `load`ing it, attaching `xts`, and setting `options(digits.secs = 6)` seems to work as expected on my machine. I noticed you say "digit.sec" (i.e. no s in secs) in the question. Is that only a typo here, or is it what you set in R as well? – user1935457 Feb 06 '13 at 09:25
  • That was a typo. Edited that Thanks. – shoonya Feb 06 '13 at 09:44
  • 2
    As with @user1935457, this works as expected for me (using R-2.15.2 and xts 0.9-3). – Joshua Ulrich Feb 06 '13 at 12:57
  • Every weekday, I load thousands of RData files containing xts objects with millisecond timestamps. Thankfully, I can't replicate your problem. – GSee Feb 06 '13 at 17:48
  • I checked it with another R-2-15.2 and it worked. I will close the question. – shoonya Feb 07 '13 at 08:30

0 Answers0