bimetsConf {bimets}R Documentation

BIMETS Global Options Configuration

Description

BIMETS package depends on some options in order to transform and to present time series data. These options can be read or changed by using the functions:
setBIMETSconf(opt,value) and getBIMETSconf(opt)

Usage

setBIMETSconf(opt=NULL, value=NULL, suppressOutput=FALSE)
getBIMETSconf(opt=NULL)

Arguments

opt

Name of the BIMETS option. Available option names are:

BIMETS_CONF_DIP: Date In Period. Users can associate to each observation in a time series the first or the last date in the period, i.e. 1 January or 31 December in the case of a yearly time series, 1 January/1 July or 30 June/31 December in the case of a semiannual time series, 1 January/31 January in the case of a monthly time series in January, etc. The assignments by date to time series (e.g. ts['2000-01-01']=value) need to be coherent to the value of this global option. Accepted values are:
LAST: (default) each observation has associated the last date of the period, e.g. 31 Mar for a quarterly time series, 31 January for a monthly time series in the first period, etc.
FIRST: each observation has associated the first date of the period, e.g. 1 Jan for a quarterly time series, 1 Feb for a monthly time series in the second period, etc.

BIMETS_CONF_CCT: Constructor Class Type. The package supports ts() and xts() time series as input arguments. Users can select the base class of a BIMETS time series, i.e. the class used when a time series is created with TIMESERIES() or converted to a BIMETS time series using as.bimets(). This is a global option; users can locally override the selection of the output class using the class='TS' or class='XTS' argument in the TIMESERIES() function. The option BIMETS_CONF_CCT can be assigned to the following values:
TS: (default) the time series constructor TIMESERIES() and the conversion function as.bimets() return an object of class ts()
XTS: the time series constructor TIMESERIES() and the conversion function as.bimets() return an object of class xts().

Please note that BIMETS package is faster using BIMETS_CONF_CCT='TS'

BIMETS_CONF_NOC: NO Compliance test. If this option is set TRUE then the compliance control check on input time series, i.e. is.bimets(), will be globally disabled. The default is set to FALSE. The compliance check on input time series should generally be active, otherwise a malformed input time series can produce unwanted results in operations.

value

The value to be assigned to the BIMETS option.

suppressOutput

If TRUE, the output messages will be disabled.

Value

This function set or read global BIMETS options, and return a NULL value.

See Also

TIMESERIES
is.bimets
as.bimets
fromBIMETStoXTS
fromBIMETStoTS
BIMETS indexing

Examples

	
	#default BIMETS_CONF_DIP is LAST
	#create ts
	ts1<-TSERIES((1:10),START=c(2000,1),FREQ=1)
	
	#transform to xts and print
	xt1<-fromBIMETStoXTS(ts1)
	print(xt1)  #....dates as of 31 Dec
	
	#set configuration BIMETS_CONF_DIP to FIRST
	setBIMETSconf('BIMETS_CONF_DIP','FIRST')
	
	#create ts
	ts1<-TSERIES((1:10),START=c(2000,1),FREQ=1)
	
	#transform to xts and print
	xt1<-fromBIMETStoXTS(ts1)
	print(xt1)  #....dates as of 1 Jan
	
	#set configuration BIMETS_CONF_DIP to LAST
	setBIMETSconf('BIMETS_CONF_DIP','LAST')
	
	#default to XTS
	setBIMETSconf('BIMETS_CONF_CCT','XTS')
	
	#check compliance of xt1 and fail...	
	is.bimets(xt1) #... FALSE
	
	#set configuration BIMETS_CONF_DIP to FIRST
	setBIMETSconf('BIMETS_CONF_DIP','FIRST')
	
	#check compliance of xt1 and ok...	
	is.bimets(xt1) #... TRUE
	
	print(getBIMETSconf('BIMETS_CONF_DIP')) # ... returns FIRST		
	print(getBIMETSconf('BIMETS_CONF_CCT')) # ... returns XTS
	
	print(is.xts(TSERIES(1:10,START=c(2000,1),FREQ=1))) #...print TRUE
	print(is.ts(TSERIES(1:10,START=c(2000,1),FREQ=1,class='TS'))) #...print TRUE
	
	
	
	#NOC
	setBIMETSconf('BIMETS_CONF_CCT','XTS')
	is.bimets(xts()) #FALSE
	setBIMETSconf('BIMETS_CONF_NOC',TRUE) 
	is.bimets(xts()) #TRUE
	
	
	#...back to defaults
	setBIMETSconf('BIMETS_CONF_DIP','LAST')
	setBIMETSconf('BIMETS_CONF_CCT','TS')
	setBIMETSconf('BIMETS_CONF_NOC',FALSE)
	
	

[Package bimets version 3.0.2 Index]