Learn R Programming

ichimoku (version 1.5.5)

matrix_df: Convert matrix to data.frame

Description

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

Usage

matrix_df(x, keep.attrs = FALSE)

Value

A ‘data.frame’ object. If the matrix has row names, these are retained by the dataframe.

Arguments

x

a matrix.

keep.attrs

[default FALSE] 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.

Examples

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

Run the code above in your browser using DataLab