Learn R Programming

bimets (version 4.0.3)

GETRANGE: Time Series Common Range

Description

Given a time series list, this function returns intersection or union of time series' ranges.

Usage

GETRANGE( x=list(), 
          type='INNER', 
          avoidCompliance=FALSE,  
          ...)

Value

This function returns the common range of the input time series as a 4-integer array built by c(START_Y,START_P,END_Y,END_P). If type='INNER' and there is no intersection of time series' ranges, then this function will return a NULL.

Arguments

x

Input list, having elements as time series of class ts or xts. This argument can be also a single time series.

type

If type='INNER' then this funtion will return the intersection (if not NULL) of input time series' ranges. If type='OUTER' then this funtion will return the union of input time series' ranges.

avoidCompliance

If TRUE, compliance control check of input time series will be skipped. See is.bimets

...

Backward compatibility.

See Also

TSJOIN
TSEXTEND
TSMERGE
MOVAVG
GETYEARPERIOD
CUMSUM

Examples

Run this code
		
	#create ts
	ts1=TSERIES((1:40), START=c(2000,1), FREQ=4)
	ts2=TSERIES((1:40), START=c(2001,1), FREQ=4)
	ts3=TSERIES((1:40), START=c(2002,1), FREQ=4)
	
	myList=list(ts1,ts2,ts3)
	
	print(GETRANGE(myList))
	print(GETRANGE(myList,type='OUTER'))

Run the code above in your browser using DataLab