Skip to content
Prev 7071 / 15274 Next

[xts] merge function weird behaviour

Well Murali,
I constructed the xts data series from 1-minute-bar OHLC series using 
the to.daily function from quantmod package.
And I took the close of the daily series.

 > str(t1)
An ?xts? object from 2007-01-02 to 2007-01-08 containing:
Data: num [1:6, 1] 97.9 97.3 96 96 95.7 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr "Close"
Indexed by objects of class: [Date] TZ: America/New_York
Original class: 'xts'
xts Attributes:
NULL
 > str(t2)
An ?xts? object from 2007-01-02 to 2007-01-08 containing:
Data: num [1:6, 1] 94.6 94.4 92.5 92.4 92.2 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr "Close"
Indexed by objects of class: [Date] TZ: America/New_York
Original class: 'xts'
xts Attributes:
NULL

#just to be sure
 > str(index(head(t1)))
Class 'Date' num [1:6] 13515 13516 13517 13518 13520 ...
 > str(index(head(t2)))
Class 'Date' num [1:6] 13515 13516 13517 13518 13520 ...

I will prepare some files to attach for tests in a following mail.
On 10/12/2010 09:30, Murali.Menon at avivainvestors.com wrote: