| cbind | R Documentation |
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 |
... |
further arguments to bind. |
deparse.level |
see the documentation of |
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"
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, ]
x
## Bind Columnwise -
X <- cbind(x[, "Open"], returns(x[, "Open"]))
colnames(X) <- c("Open", "Return")
X
## Bind Rowwise -
Y <- rbind(x[1:3, "Open"], x[10:12, "Open"])
Y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.