TSPROJECT {bimets}R Documentation

Project a Time series

Description

This function projects the input time series into a time interval. The output class can be either a time series (default) or a one-dimensional array if the argument ARRAY=TRUE.

Usage

TSPROJECT(x=NULL, TSRANGE=NULL, ARRAY=FALSE, 
          EXTEND=FALSE, avoidCompliance=FALSE,...)

Arguments

x

Input time series that must satisfy the compliance control check defined in is.bimets.

TSRANGE

Date range of data projection. TSRANGE must be specified as a numerical array composed by starting year, starting period, ending year and ending period of projection,
i.e. TSRANGE=c(START_YEAR,START_PERIOD,END_YEAR,END_PERIOD).

ARRAY

If TRUE this function will return a numerical array built with observation values that lie in the specified time range. If FALSE (default) the output will be a time series.

EXTEND

If TRUE and in the case that the input time series does not overlap with the provided TSRANGE, the output time series will be extended over the TSRANGE by inserting missing values NA into the new observations.

avoidCompliance

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

...

Backward compatibility.

Value

This function returns a BIMETS time series, or a numerical array if the argument ARRAY=TRUE, built by projecting the input time series into the provided TSRANGE.

See Also

TSJOIN
TSEXTEND
TSMERGE
MOVAVG
GETYEARPERIOD
CUMSUM
TSTRIM

Examples

		
	#create yearly ts
	ts1<-TSERIES((1:10),START=c(2000,1),FREQ=1)
  	
	print(TSPROJECT(ts1,TSRANGE=c(2002,1,2005,1)))	#print projected ts from 2002 to 2005
	
	print(TSPROJECT(ts1,TSRANGE=c(2001,1,2004,1),ARRAY=TRUE)) #print c(2,3,4,5)
	
	print(TSPROJECT(ts1,TSRANGE=c(1998,1,2002,1),EXTEND=TRUE,ARRAY=TRUE)) 
	#print c(NA,NA,1,2,3)
	

[Package bimets version 3.0.2 Index]