8000 [R-Forge #1602] Can't merge multiple objects with character values · Issue #44 · joshuaulrich/xts · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[R-Forge #1602] Can't merge multiple objects with character values #44
@joshuaulrich

Description

@joshuaulrich

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0