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)

Arguments

xts

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

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: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

tbl2xts documentation built on Aug. 1, 2019, 5:05 p.m.