Skip to content

cbind giving NA's?

1 message · Joshua Ulrich

#
Note that this issue was raised on StackOverflow recently.
http://stackoverflow.com/questions/7678090/xts-merge-odd-behaviour

Here's the solution:

index(a) <- index(a)
index(b) <- index(b)
merge(a,b)
           ZWD.UGX SCHB.Close
2010-03-31      NA      28.02
2010-04-01  7.6343         NA
2010-04-02  7.6343         NA
2010-04-03  7.5458         NA
2010-04-04  7.4532      28.30
2010-04-05  7.4040      28.38
2010-04-06  7.3317      28.21
2010-04-07      NA      28.31
2010-04-08      NA      28.47

Jeff's answer on StackOverflow explains why this works.

Best,
--
Joshua Ulrich ?| ?FOSS Trading: www.fosstrading.com



On Fri, Aug 26, 2011 at 8:09 AM, R. Michael Weylandt
<michael.weylandt at gmail.com> wrote: