rdb_to_xts: Transform the data.table object into a xts object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rdb_to_xts.R

Description

For some analysis, it is more convenient to have a xts object instead of a data.table object.

Usage

1
2
3
4
5
rdb_to_xts(
  x,
  needed_columns = c("period", "series_code", "series_name", "value"),
  series_columns = c("series_code", "series_name")
)

Arguments

x

data.table. The data.table returned by the rdb function.

needed_columns

Vector of character strings (default c("period", "series_code", "series_name", "value")). Vector of column names which are needed to transform the data.table into a xts object.

series_columns

Vector of character strings (default c("series_code", "series_name")). Vector of series column names.

Value

A xts object.

Author(s)

Sebastien Galais

See Also

rdb, rdb_rename_xts

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(xts)
library(data.table)
library(rdbnomics)

df <- rdb("IMF", "BOP", mask = "A.FR+ES.BCA_BP6_EUR")
rdb_to_xts(df)

## End(Not run)

rdbnomics documentation built on Oct. 26, 2020, 1:06 a.m.