SeriesRequest-class {MacrobondAPI}R Documentation

SeriesRequest class

Description

Use this class to set up a request of unified series. Once the parameters are configured, the object is passed to FetchTimeSeries in order to download and process the time series.

Default values of properties:

Frequency "Highest"
Currency "" (No conversion)
StartDate "" (No limit)
StartDateMode "DataInAnySeries"
EndDate "" (No limit)
EndDateMode "DataInAnySeries"
CalendarMergeMode "AvailableInAny"

Objects from the Class

Objects are created by calling CreateUnifiedTimeSeriesRequest.

Methods

addSeries

signature(m = "SeriesRequest", name = "character"): Add a series to a uniform series request. It returns a value of type SeriesExpression, which can be used to set further properties.

FetchTimeSeries

signature(request = "SeriesRequest"): Download one or more series from the database. The parameter can be a string, a vector of series names or an object created by CreateUnifiedTimeSeriesRequest. The result is a vector of series in the same order as requested.

getAddedSeries

signature(m = "SeriesRequest"): Get a list of the series added to the request. The elements are of type SeriesExpression.

getFrequency

signature(object = "SeriesRequest"): Set the frequency as a value from the list TimeSeriesFrequency.

setFrequency

signature(m = "SeriesRequest", f = "TimeSeriesFrequencyClass"): value from the list TimeSeriesFrequency.

setFrequency

signature(m = "SeriesRequest", f = "character"): Set the frequency for a unified series request with a name from the list TimeSeriesFrequency.

getWeekdays

signature(object = "SeriesRequest"): Get a bit set of what weekdays that are used for daily timeseries. The bits are defined for Monday-Sunday in the list TimeSeriesWeekdays.

setWeekdays

signature(m = "SeriesRequest", weekdays = "TimeSeriesWeekdaysClass"): Sets what days to include for a daily series. Typical values can be found in the list TimeSeriesWeekdays.

setWeekdays

signature(m = "SeriesRequest", weekdays = "character"): Set the name of the weekday pattern to use for daily series from the list TimeSeriesWeekdays.

getCurrency

signature(m = "SeriesRequest"): Get the currency code used for currency conversion. An empty string, which is the default value, means that no conversion will take place.

setCurrency

signature(m = "SeriesRequest", currency = "character"): Set the currency code, based on the three letter ISO 4217 codes, that will be used to convert any series expressed in currency units. The default is an empty string, which means that no currency conversion will be done. A list of the supported currencies can be found here: List of currency codes.

getStartDate

signature(object = "SeriesRequest"): Set the start date used for all the series in the request. The value can be an empty string, a specific date or a string representing a point in time as described below. If it is empty or a relative reference, the StartDateMode will be used to determine the end.

setStartDate

signature(object = "SeriesRequest", startDate = "Date"): Set a specific date from which to include data.

setStartDate

signature(object = "SeriesRequest", startDate = "character"): Set a relative start date from which to include data. See below.

getStartDateMode

signature(m = "SeriesRequest"): Determines if the automatic start of the series is at the last point when there is data in any series or the last point where there is data in all series. This setting is not used when the StartDate property is set to an absolute point in time. The default is "DataInAnySeries".

setStartDateMode

signature(m = "SeriesRequest", dateMode = "CalendarDateModeClass"): Set the mode with a value from the list CalendarDateMode.

setStartDateMode

signature(m = "SeriesRequest", dateMode = "character"): Set the mode with a name from the list CalendarDateMode.

getEndDate

signature(object = "SeriesRequest"): This specifies the end date used for all the series in the request. The value can be empty, a specific date or a string representing a point in time as described below. If it is empty or a relative reference, the EndDateMode will be used to determine the end.

setEndDate

signature(object = "SeriesRequest", endDate = "Date"): Include data until and including the specified date.

setEndDate

signature(object = "SeriesRequest", endDate = "character"): Set a relative end date for the data. See below.

getEndDateMode

signature(m = "SeriesRequest"): Determines if the automatic end of the series is at the last point when there is data in any series or the last point where there is data in all series. The default is "DataInAnySeries". This setting is not used when the EndDate property is set to an absolute point in time.

setEndDateMode

signature(m = "SeriesRequest", dateMode = "CalendarDateModeClass"): Set the mode with a value from the list CalendarDateMode.

setEndDateMode

signature(m = "SeriesRequest", dateMode = "character"): Set the mode with a name from the list CalendarDateMode.

getCalendarMergeMode

signature(m = "SeriesRequest"): Returns the setting how to handle points in time that are not available in one or more series. It returns a value from the list CalendarMergeMode.

setCalendarMergeMode

signature(m = "SeriesRequest", mergeMode = "CalendarMergeModeClass"): Set how to handle points in time that are not available in one or more series. The value should be from the list CalendarMergeMode.

setCalendarMergeMode

signature(m = "SeriesRequest", mergeMode = "character"): Set how to handle points in time that are not available in one or more series. The value should be a name from the list CalendarMergeMode.

show

signature(object = "SeriesRequest"): Show a summary of the time series request.

Note

Relative StartDate The relative references, starting with "-", will be affected by the EndDateMode.

"" The reference date depending on the StartDateMode property. This is the default value.
"1995" The start of 1995.
"1995-05" The start of May 1995.
"1995-05-01" From and uncluding 1 May 1995.
"-50" The last fifty observations.
"-2y" The observations of the two last years.
"-1q" The observations of the three months.
"-3w" The observations of the three last weeks.
"-5d" The observations of the five last days.

Relative EndDate The EndDateMode property determines the reference point for the relative date.

"" The reference date. This is the default value.
"1995" The end of 1995
"1995-05" The end of May 1995
"1995-05-01" Until and uncluding 1 May 1995
"-50" Fifty observations before the reference date
"-2y" Two years before the reference date
"-1q" One quarter before the reference date
"-3w" Three weeks before the reference date
"-5d" Five days before the reference date

See Also

CreateUnifiedTimeSeriesRequest, SeriesExpression

Examples

seriesRequest <- CreateUnifiedTimeSeriesRequest()
setFrequency(seriesRequest, "Monthly")
addSeries(seriesRequest, "usgdp")
seriesExpressionCpi <- addSeries(seriesRequest, "uscpi")
setMissingValueMethod(seriesExpressionCpi, "None")
twoSeries <- FetchTimeSeries(seriesRequest)

[Package MacrobondAPI version 1.1-5 Index]