xts_tbl: xts_tbl

Description Usage Arguments Value Examples

View source: R/xts_tbl.R

Description

This function converts data from a xts object to a tbl_df(). 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

1
xts_tbl(xts, Colnames_Exact = FALSE)

Arguments

xts

A xts series that will be converted to a tbl_df().

Colnames_Exact

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

Value

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

Examples

1
2
3
4
5
6
## Not run: 
library(dplyr)
data(TRI)
df_xts_tbl <- TRI %>% tbl_xts(., cols_to_xts = TRI, spread_by = Country) %>% xts_tbl()

## End(Not run)

Example output

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

tbl2xts documentation built on Jan. 16, 2021, 5:19 p.m.