Learn R Programming

tbl2xts (version 1.0.6)

xts_tbl: xts_tbl

Description

This function converts data from a xts object to a tibble. Note that the dataframe must be of type xts and ordered by a date column. This date column will be preserved and save as "date".

Usage

xts_tbl(xts, Colnames_Exact = FALSE)

Value

A tbl_df() with the first column the "date" column used to order the xts series by.

Arguments

xts

A xts series that will be converted to a tibble.

Colnames_Exact

Stops xts natively replacing spaces in column names with full stops. Kept FALSE as default, as most users expect this behavior.

Examples

Run this code
if (FALSE) {
library(dplyr)
data(TRI)
df_xts_tbl <- TRI %>% tbl_xts(., cols_to_xts = TRI, spread_by = Country) %>% xts_tbl()
}

Run the code above in your browser using DataLab