(x <- xts(4:10, Sys.Date()+4:10))
(y <- xts(1:6, Sys.Date()+1:6))
merge(x,y)
merge(x,y, join='inner')
merge(x,y, join='left')
merge(x,y, join='right')
merge.zoo(zoo(x),zoo(y),zoo(x), all=c(TRUE, FALSE, TRUE))
merge(merge(x,x),y,join='left')[,c(1,3,2)]
# zero-width objects (only index values) can be used
xi <- xts( , index(x))
merge(y, xi)
Run the code above in your browser using DataLab