tsdf {ggseas}R Documentation

Time series to data frame

Description

Convert a ts object to data.frame with columns for time period and the original data

Usage

tsdf(timeseries, colname = "x")

Arguments

timeseries

an object of class ts or mts

colname

Column name to give to the time period column

Details

A convenience function to create a data frame from a time series or multiple time series object. The motivation is to make it easy to pass time series data to functions that need data frames such as ggplot2.

Value

a data.frame with the same number of rows as the original time series

Examples

head(tsdf(AirPassengers))

ld <- cbind(fdeaths, mdeaths)
head(tsdf(ld))

[Package ggseas version 0.5.4 Index]