For example, I have two ZOO objects:
x <- zoo(matrix(1:10, 10, 2), 1:10)
y <- zoo(matrix(11:20, 10, 2), 5:15)
I want to get first index value, which have both ZOO objects. In this example it must be index value of 5. Because index of 5 have both objects and this is most recent index.
I can loop index(x) vector and with inner loop compare every index(y) element with index(x) elements, but this looks ugly. Can i do that without looping? Thanks.
UPDATE: I found that I can do following:
idx_val <- head(intersect(index(x), index(y)), 1)
This is clear and fast solution? If yes, then question is closed.