ts_default: Default Column Names

Description Usage Arguments Value Examples

View source: R/ts_default.R

Description

In data frame objects (data.frame, tibble, data.table), tsbox automatically detects the time and the value column. This function changes the column names to the defaults (time, value), so that auto-detection can be avoided in future operations.

Usage

1

Arguments

x

ts-boxable time series, an object of class ts, xts, zoo, data.frame, data.table, tbl, tbl_ts, tbl_time, tis, irts or timeSeries.

Value

a ts-boxable time series, with the same class as the input.

Examples

1
2
3
4
5
df <- ts_df(ts_c(mdeaths, fdeaths))
# non-default colnames
colnames(df) <- c("id", "date", "count")
# switch back to default colnames
head(ts_default(df))

tsbox documentation built on April 30, 2020, 1:05 a.m.