tsObj_to_dt: Function converts a time series object to a 'data.table'

View source: R/tsObj_to_dt.R

tsObj_to_dtR Documentation

Function converts a time series object to a data.table

Description

The function tsbox::ts_df() is incorporated to return a data.table from a time object of classes ts, xts, mts, or zoo. In the data.table the series' time index is named "time" and corresponding values as "value". If the series is a multiple time series (mts) then an index column is created (named "id") with the names of the variables.

Usage

tsObj_to_dt(series = NULL, wide_form = FALSE)

Arguments

series

A ts, xts, mts, or zoo time series object

wide_form

A logical which if TRUE will reshape the data.table to wide form.

Value

A data.table


deandevl/RtsaPkg documentation built on Oct. 5, 2023, 5:23 p.m.