Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fromBIMETStoTS

Convert BIMETS to TS


Description

This function transforms a BIMETS compliant time series (as defined in is.bimets) into a time series of class ts(). The core R function as.ts() does not satisfy all the requirements of the compliance control check, so it has been extended. Attributes and description of the input time series will be copied to the output time series (see TIMESERIES).

Usage

fromBIMETStoTS(x = NULL, ...)

Arguments

x

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

...

Backward compatibility.

Value

This function returns a time series of class ts() that has the same observations of the input BIMETS time series.

See Also

Examples

#work with XTS
	setBIMETSconf('BIMETS_CONF_CCT','XTS')
	
	#create yearly time series
	xts=TSERIES(1:10,START=c(2000,1),FREQ='A')
	print(is.ts(xts))#FALSE
	#convert to ts
	ts=fromBIMETStoTS(xts)
	print(is.ts(ts))#TRUE
	print(ts)
	
	#create monthly time series
	xts=TSERIES(1:10,START=c(2000,1),FREQ='M')
	print(is.ts(xts))#FALSE
	#convert to ts
	ts=fromBIMETStoTS(xts)
	print(is.ts(ts))#TRUE
	print(ts)
	
	#create daily time series
	xts=TSERIES(1:10,START=c(2000,1),FREQ='D')
	print(is.ts(xts))#FALSE
	#convert to ts
	ts=fromBIMETStoTS(xts)
	print(is.ts(ts))#TRUE
	print(ts)
	

	
	#reset default	
	setBIMETSconf('BIMETS_CONF_CCT','TS')

bimets

Time Series and Econometric Modeling

v1.5.3
GPL-3
Authors
Andrea Luciani [aut, cre], Roberto Stok [aut], Bank of Italy [cph]
Initial release
2021-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.