base-cbind: Bind 'timeSeries' objects by column or row

cbindR Documentation

Bind 'timeSeries' objects by column or row


Binds "timeSeries" objects either by column or by row.


## S3 method for class 'timeSeries'
cbind(..., deparse.level = 1)
## S3 method for class 'timeSeries'
rbind(..., deparse.level = 1)

## S4 method for signature 'timeSeries,ANY'
cbind2(x, y)
## other methods for 'cbind2' with the same arguments, see Details

## S4 method for signature 'timeSeries,ANY'
rbind2(x, y)
## other methods for 'rbind2' with the same arguments, see Details


x, y

objects, at least one of whom is of class "timeSeries".


further arguments to bind.


see the documentation of base::cbind.


These functions bind the objects by row rXXX or column (cXXX.

cbind and rbind are S3 generics, so the "timeSeries" methods describe here are called only when the first argument is "timeSeries".

cbind2 and rbind2 are S4 generics which dispatch on the first two arguments. The "timeSeries" methods for these are invoked whenever at least one of the first two arguments is of class "timeSeries".

All functions can be called with more than two arguments. After the first two are merged, the result is merged with the third, and so on.


an object of class "timeSeries"

See Also

merge for another way to merge "timeSeries" object column-wise.

rbind and cbind from base R,

rbind2 and cbind2 from package "methods",


## Load Microsoft Data Set -
   x <- MSFT[1:12, ]

## Bind Columnwise -
   X <- cbind(x[, "Open"], returns(x[, "Open"]))
   colnames(X) <- c("Open", "Return")

## Bind Rowwise - 
   Y <- rbind(x[1:3, "Open"], x[10:12, "Open"])

timeSeries documentation built on June 22, 2024, 6:59 p.m.