TSJOIN {bimets} | R Documentation |
Join Time Series
Description
This function returns the join of the two input time series. If the first time series overlaps the second time series, output data is taken from the first time series up to the second time series's
starting date, the remainder of the data being taken from the second time series.
A different joining period can be specified by using the JPRD
argument.
The two time series must have the same frequency.
Usage
TSJOIN(x = NULL, y = NULL, JPRD = NULL, ALLOWGAP = FALSE,
WARN = FALSE, avoidCompliance = FALSE, ...)
Arguments
x |
First input time series that must satisfy the compliance control check defined in |
y |
Second input time series that must satisfy the compliance control check defined in |
JPRD |
This argument defines a joining period other than the starting period of the second time series.
It must be defined as |
ALLOWGAP |
if |
WARN |
Print a warning message if the two time series do not overlap or if the first time series starts after the |
avoidCompliance |
If |
... |
Backward compatibility. |
Value
This function returns a BIMETS time series that is built by joining the two input time series.
See Also
TSLAG
TSEXTEND
TSMERGE
TSPROJECT
Examples
#day and month names can change depending on locale
Sys.setlocale('LC_ALL','C')
Sys.setlocale('LC_TIME','C')
#TS
ts1<-TSERIES((1:10),START=c(1985,1),FREQ=1)
ts2<-TSERIES((1:10),START=c(2000,1),FREQ=1)
TABIT(ts1,ts2,TSJOIN(ts1,ts2,ALLOWGAP=TRUE))
#XTS
setBIMETSconf('BIMETS_CONF_CCT','XTS')
n<-10
xArr<-(0:n)
dateArr<-as.yearqtr('1997 Q1')+ 0:n/4
dataF<-data.frame(dateArr,xArr)
ts1<-xts(dataF[,2],order.by=dataF[,1])
dateArr<-as.yearqtr('2000 Q1')+ 0:n/4
dataF<-data.frame(dateArr,xArr)
ts2<-xts(dataF[,2],order.by=dataF[,1])
TABIT(ts1,ts2,TSJOIN(ts1,ts2,ALLOWGAP=TRUE,JPRD=yq2yp(as.yearqtr("2001 Q3"))))
#restore default
setBIMETSconf('BIMETS_CONF_CCT','TS')