[R-SIG-Finance] Index time change when coercing zoo object to xts

Brian G. Peterson brian at braverock.com
Thu Jul 23 12:45:19 CEST 2009


Tseng Ko wrote:
> Dear all,
>
>   I tried to trasnform a zoo object to xts.
>
>   
>> x1
>>     
>                         C   V
> (07/23/09 15:13:00) 19815 238
> (07/23/09 15:14:00) 19805 291
> (07/23/09 15:15:00) 19816 298
> (07/23/09 15:16:00) 19820 357
> (07/23/09 15:17:00) 19813 218
> (07/23/09 15:18:00) 19789 203
>
>   
>> as.xts(x1)
>>     
>                         C   V
> (07/23/09 15:12:59) 19815 238
> (07/23/09 15:13:59) 19805 291
> (07/23/09 15:14:59) 19816 298
> (07/23/09 15:15:59) 19820 357
> (07/23/09 15:17:00) 19813 218
> (07/23/09 15:18:00) 19789 203
>
> Some data elements have 1 sec difference. Is it a bug in xts?
>   
You probably need to give the list more information to help you diagnose 
your problem.  Your test case is not self-contained and repeatable.

- What class is the index of your original object?
- What happens to the display if you set options(digits.secs=6)?
- What versions of R, xts, zoo are you using?
- Can you attach the R object that you use for this test case to your reply?

It seems mst likely to me that the index of your original object is 
something other than POXIXct, and that the representation misses when 
converted, but we won't know that for certain until you add some extra 
details and provide a test object so that others can test and repeat.

Regards,

  - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list