tsconvert.tsmodel.distribution: Convert a distribution object to a long form data.table

View source: R/convert.R

tsconvert.tsmodel.distributionR Documentation

Convert a distribution object to a long form data.table

Description

Converts an object of class “tsmodel.distribution” or “tsmodel.distribution_list” to a long form data.table object.

Usage

## S3 method for class 'tsmodel.distribution'
tsconvert(object, to = "data.table", name = NULL, ...)

## S3 method for class 'tsmodel.distribution_list'
tsconvert(object, to = "data.table", ...)

Arguments

object

a “tsmodel.distribution” or “tsmodel.distribution_list” object.

to

output format. Currently only “data.table” supported.

name

an optional string for the name of the series which will be added to the table (only for the “tsmodel.distribution”, as the list object is already validated with names).

...

not currently used.

Value

a data.table object

Examples

x1 <- matrix(rnorm(100), 10, 10)
colnames(x1) <- as.character(as.Date(1:10, origin = "1970-01-01"))
class(x1) <- "tsmodel.distribution"
head(tsconvert(x1, name = "SeriesA"))

tsmodels/tsmethods documentation built on Nov. 17, 2024, 12:34 a.m.