Merges two 'timeSeries' objects

Share:

Description

Merges several object types with 'timeSeries' objects. The number of rows must match.

Details

The following combinations are supported:

timeSeries ANY
timeSeries missing
timeSeries numeric
timeSeries matrix
timeSeries timeSeries

Value

Returns a 'timeSeries' object of two merged time series.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Load Series -
   x <- MSFT[1:12, ]

## Merge 'timeSeries' with missing Object -
   merge(x)

## Merge 'timeSeries' with numeric Object -
   y <- rnorm(12)
   class(y)
   merge(x, y)

## Merge 'timeSeries' with matrix Object -
   y <- matrix(rnorm(24), ncol=2)
   class(y)
   merge(x, y)

## Merge 'timeSeries' with matrix Object -
   y <- timeSeries(data=rnorm(12), charvec=time(x))
   class(y)
   merge(x, y)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.