xts_df: Convert xts to data.frame

View source: R/utils.R

xts_dfR Documentation

Convert xts to data.frame

Description

An optimised 'xts' to 'data.frame' constructor.

Usage

xts_df(x, keep.attrs)

Arguments

x

an 'xts' object.

keep.attrs

(optional) if set to TRUE, will preserve any custom attributes set on the original object.

Details

The optimised data.frame constructors are used internally within the package and made available as utilities. Please note that no data validation or checking is performed.

Value

A 'data.frame' object. The 'xts' index is preserved as the first column with header 'index'.

Examples

cloud <- ichimoku(sample_ohlc_data)
df <- xts_df(cloud)
str(df)

df2 <- xts_df(cloud, keep.attrs = TRUE)
str(df2)


ichimoku documentation built on May 23, 2022, 9:05 a.m.