as_ts_df: Converts a ts or mts object to a dataframe

Description Usage Arguments Details Value See Also Examples

Description

as.ts.df transfroms a ts or mts object to a dataframe

Usage

1
as_ts_df(ts_obj, date_col = TRUE)

Arguments

ts_obj

the ts or mts object to be converted into a dataframe

date_col

Flag variable. If TRUE, then the time variable in the new dataframe will be a date object

Details

The first column of the new dataframe holds the time/date in in a column labeled "time"

Note: If the data are quarterly, the first quarter will be translated to "YYYY-01-01", if monthly the first month will be translated to "YYYY-01-01" and so on

Value

dataframe where a column of class "Date" where the first column is labeled "time"

See Also

as_zoo_df

Examples

1
2
3
4
5
6
7
#USMacrsoSW form the AER package is an "mts" object
library(AER)
data("USMacroSW")
as_ts_df(USMacroSW)
#Using the AirPassengers data
data(AirPassengers)
as_ts_df(AirPassengers)

ChandlerLutz/ggts documentation built on May 6, 2019, 9:56 a.m.