Convert time-series-like to data.frame

Share:

Description

Convert time-series-like to data.frame

Usage

1
2
3
4
## S3 method for class 'ts'
fortify(model, data = NULL, columns = NULL, is.date = NULL,
  index.name = "Index", data.name = "Data", scale = FALSE, melt = FALSE,
  ...)

Arguments

model

time-series-like instance

data

original dataset, if needed

columns

character vector specifies target column name(s)

is.date

logical frag indicates whether the stats::ts is date or not If not provided, regard the input as date when the frequency is 4 or 12

index.name

specify column name for time series index

data.name

specify column name for univariate time series data. Ignored in multivariate time series.

scale

logical flag indicating whether to perform scaling each timeseries

melt

logical flag indicating whether to melt each timeseries as variable

...

other arguments passed to methods

Value

data.frame

Examples

1
2
3
4
5
fortify(AirPassengers)
fortify(timeSeries::as.timeSeries(AirPassengers))
fortify(tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2)))
fortify(stats::stl(UKgas, s.window = 'periodic'))
fortify(stats::decompose(UKgas))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.