Learn R Programming

xts (version 0.13.0)

rbind.xts: Concatenate Two or More xts Objects by Row

Description

Concatenate or bind by row two or more xts objects along a time-based index.

Usage

# S3 method for xts
c(...)

# S3 method for xts rbind(..., deparse.level = 1)

Value

An xts object with one row per row for each object concatenated.

Arguments

...

objects to bind

deparse.level

not implemented

Author

Jeffrey A. Ryan

Details

Implemented in C, these functions bind xts objects by row, resulting in another xts object

There may be non-unique index values in either the original series, or the resultant series.

Identical indexed series are bound in the order or the arguments passed to rbind. See examples.

All objects must have the same number of columns, as well as be xts objects or coercible to such.

rbind and c are aliases.

For traditional merge operations, see merge.xts and cbind.xts.

See Also

merge.xts rbind

Examples

Run this code
x <- xts(1:10, Sys.Date()+1:10)
str(x)

merge(x,x)
rbind(x,x)
rbind(x[1:5],x[6:10])

c(x,x)

# this also works on non-unique index values
x <- xts(rep(1,5), Sys.Date()+c(1,2,2,2,3))
y <- xts(rep(2,3), Sys.Date()+c(1,2,3))

# overlapping indexes are appended
rbind(x,y)
rbind(y,x)

Run the code above in your browser using DataLab