Merging only zero-width xts objects returns a zero-length result #227
Closed
Description
merge.xts()
returns a completely empty xts object if you merge only empty objects. merge.zoo()
returns a zero-width object with the appropriate index values.
> merge(.xts(,1:3), .xts(,2:4)) # index is empty
Data:
numeric(0)
Index:
integer(0)
> merge(zoo(,1:3), zoo(,2:4)) # index is merged
Data:
numeric(0)
Index:
[1] 1 2 3 4
> merge(.xts(,1:3), .xts(,2:4), .xts(,0:2)) # index is empty
Data:
numeric(0)
Index:
integer(0)
> merge(zoo(,1:3), zoo(,2:4), zoo(,0:2)) # index is merged
Data:
numeric(0)
Index:
[1] 0 1 2 3 4