Extract a Time Series from a Data.table

Share:

Description

This function extracts time series from data.table columns and returns object of class ts.

Usage

1
2
extractTimeSeries(data_table, time_column, group_list, freq, item, variable,
  prefix = "CH.KOF.IND")

Arguments

data_table

a data.table

time_column

character name of the column which contains the time index

group_list

list or NULL

freq

integer value either 4 denoting quarterly frequency or 12 denoting quarterly frequency

item

character name of the column which contains the item that is extracted from the data.table

variable

character name of the variable selected

prefix

character prefix attached to the dynamically generated key string to identify the time series. Recommend key format: ISOcountry.provider.source.aggregationLevel.selectedGroup.variable.item

Author(s)

Matthias Bannert, Gabriel Bucur