tbind: Bind Time Series

Description Usage Arguments Details Value See Also Examples

View source: R/tframe.R

Description

Bind together (in non-time dimension) two time series objects.

Usage

1
2
3
4
5
6
    tbind(x, ..., pad.start=TRUE, pad.end=TRUE, warn=TRUE)
    ## Default S3 method:
tbind(x, ..., pad.start=TRUE, pad.end=TRUE, warn=TRUE)
    ## S3 method for class 'ts'
tbind(x, ..., pad.start=TRUE, pad.end=TRUE, warn=TRUE)
    

Arguments

x

A time series object.

...

Time series objects.

pad.start

Logical indicating if the start should be truncated or padded with NAs to align time.

pad.end

Logical indicating if the end should be truncated or padded with NAs to align time.

warn

Logical indicating if warnings should be issued.

Details

Bind data as in cbind (or formerly tsmatrix) and align time dimension. The default action pads series with NA to time union. If pad.start and/or pad.end is FALSE and the intersection is empty then NULL is returned and a warning is issued if warn=TRUE.

Value

A time series object

See Also

tfwindow, trimNA, splice

Examples

1
2
tbind(    ts(matrix(rnorm(24),24,1), start=c(1986,1), frequency=4),
    ts(matrix(rnorm(6),  6,1), start=c(1986,1), frequency=4))

Example output

          Series 1   Series 1
1986 Q1 -0.8617361 -1.2344009
1986 Q2 -1.7074391 -0.8516163
1986 Q3 -0.5463702  0.6576353
1986 Q4  1.2895367 -0.7319707
1987 Q1 -0.1021842  0.3100814
1987 Q2 -1.5324309 -1.1621367
1987 Q3 -0.9376819         NA
1987 Q4  0.8627329         NA
1988 Q1  0.1138250         NA
1988 Q2  1.2390055         NA
1988 Q3  0.9874782         NA
1988 Q4 -1.0379354         NA
1989 Q1  2.0182008         NA
1989 Q2  0.2572655         NA
1989 Q3 -1.1050162         NA
1989 Q4  0.3730449         NA
1990 Q1 -1.4851290         NA
1990 Q2 -1.0681606         NA
1990 Q3 -0.1630884         NA
1990 Q4  0.1520280         NA
1991 Q1 -0.7681752         NA
1991 Q2 -0.2014472         NA
1991 Q3  1.3154452         NA
1991 Q4  0.3888900         NA

tframe documentation built on Sept. 23, 2019, 3:01 a.m.

Related to tbind in tframe...