fromBIMETStoTS {bimets}R Documentation

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

fromBIMETStoXTS
as.bimets
is.bimets
BIMETS indexing
BIMETS configuration

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')

[Package bimets version 1.5.3 Index]