Learn R Programming

rdbnomics (version 0.6.4)

rdb_rename_xts: Rename the xts object columns

Description

In the xts object returned by the function rdb_to_xts, the series codes are used as column names. If you prefer the series names (or apply a function to them), the function rdb_rename_xts is here for that.

Usage

rdb_rename_xts(x, fun = NULL, ...)

Arguments

x

xts object. The xts object returned by the function rdb_to_xts.

fun

function (default NULL). The function to apply to the column names.

...

Arguments for the function fun.

Value

A xts object.

See Also

rdb, rdb_to_xts

Examples

Run this code
# NOT RUN {
library(xts)
library(data.table)
library(rdbnomics)

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

Run the code above in your browser using DataLab