xts objects are aligned by index before operations are done. Note that low2$daco.Close + low3$daco.Close
probably doesn't return what you thought it would either.
This is what you are passing to your if
statement:
> low2$daco.Close < low3$daco.Close
[,1]
> str(low2$daco.Close < low3$daco.Close)
An 'xts' object of zero-width
You can use coredata
on one or both of the xts objects.
low2$daco.Close < coredata(low3$daco.Close)
# daco.Close
#2013-07-22 FALSE
or you could coerce one or both of them to numeric
first
as.numeric(low2$daco.Close) < as.numeric(low3$daco.Close)
#[1] FALSE
If they did in fact have the same index it should have just worked.
index(low3) <- index(low2)
low2$daco.Close < low3$daco.Close
# daco.Close
#2013-07-22 FALSE