CreateTimeSeriesObject {MacrobondAPI}R Documentation

Create a timeseries object

Description

Create a TimeSeries object that can be uploaded to the server using the UploadOneOrMoreTimeSeries method.

Usage

CreateTimeSeriesObject(name, description, region, category, frequency, startDateOrDates, values, dayMask = TimeSeriesWeekdays[["MondayToFriday"]], metadata = CreateEmptyMetadata())

Arguments

name

The name of the time series. This must start with one of the prefixes "ih:mb:priv:", "ih:mb:com:", "ih:mb:dept:" or "ih:mb:lib:" and followed by a name that starts with a letter (a-z) and is followed by letters and digits.

description

A single line of text that describes the time series. This will, for instance, be used as the default title in charts.

region

A region code based on the ISO 3166 standard. There is a list of supported codes here: List of region codes.

category

The category of the series. This is used to group the series when browsing the database.

frequency

A value or name from the list TimeSeriesFrequency.

startDateOrDates

A single date, which will be used as the start date, or a list with one date for each observation.

values

A vector of values.

dayMask

Optionally a value or name from the list TimeSeriesWeekdays to be used for daily time series. The default value is "MondayToFriday".

metadata

Optionally a Metadata object.

Value

A object of type TimeSeries is returned.

See Also

CreateTimeSeriesObjectWithForecastFlags, TimeSeries, UploadOneOrMoreTimeSeries

Examples

	seriesNew = CreateTimeSeriesObject("ih:mb:priv:s1", "My forecast", "us", "Forecasts", "Monthly", as.Date("1990-01-01"), c(12.2, 12.7, 12.8, 13.0))
	UploadOneOrMoreTimeSeries(seriesNew)

[Package MacrobondAPI version 1.1-5 Index]