-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Description
Submitted by: Ken Williams (@kenahoo)
Assigned to: Nobody
R-Forge link
It appears that the merge() function fails when fed more than 2 xts objects, and they contains character data:
> x <- xts(letters[1:5], Sys.Date() + cumsum(1:5)*60)
> merge(x)
[,1]
2011-09-28 'a'
2011-09-30 'b'
2011-10-03 'c'
2011-10-07 'd'
2011-10-12 'e'
> merge(x,x)
x x.1
2011-09-28 'a' 'a'
2011-09-30 'b' 'b'
2011-10-03 'c' 'c'
2011-10-07 'd' 'd'
2011-10-12 'e' 'e'
> merge(x, x, x)
Error in merge.xts(x, x, x) : unsupported data type
By contrast, it works fine when the data is numeric:
> merge(x)
[,1]
2011-09-28 1
2011-09-30 2
2011-10-03 3
2011-10-07 4
2011-10-12 5
> merge(x,x)
x x.1
2011-09-28 1 1
2011-09-30 2 2
2011-10-03 3 3
2011-10-07 4 4
2011-10-12 5 5
> merge(x,x,x)
x x.1 x.2
2011-09-28 1 1 1
2011-09-30 2 2 2
2011-10-03 3 3 3
2011-10-07 4 4 4
2011-10-12 5 5 5
Perhaps something's being silently converted to a factor internally?
-Ken