matrix_df: Convert matrix to data.frame

View source: R/utils.R

matrix_dfR Documentation

Convert matrix to data.frame

Description

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

Usage

matrix_df(x, keep.attrs)

Arguments

x

a matrix.

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. If the matrix has row names, these are retained by the dataframe.

Examples

cloud <- ichimoku(sample_ohlc_data)
mcloud <- as.matrix(cloud)
df <- matrix_df(mcloud)
str(df)
str(rownames(df))


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