Learn R Programming

lazytrade (version 0.5.4)

to_m: Convert time series data to matrix with defined number of columns

Description

Transforms Time Series Column of the dataframe to the matrix with specified number of columns. Number of rows will be automatically found. Eventually not complete last row will be discarded.

[Superseded]

Usage

to_m(x, n_cols)

Value

  • matrix with specified amount of rows

Arguments

x
  • dataframe with one column

n_cols
  • number of columns in the matrix

Examples

Run this code

library(magrittr)
library(lazytrade)
macd_m <- seq(1:1000) %>% as.data.frame() %>% to_m(64)


Run the code above in your browser using DataLab