Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gts

Create a simts TS object using time series data


Description

Takes a time series and turns it into a time series oriented object that can be used for summary and graphing functions in the simts package.

Usage

gts(data, start = 0, end = NULL, freq = 1, unit_ts = NULL,
  unit_time = NULL, name_ts = NULL, name_time = NULL,
  data_name = NULL, Time = NULL, time_format = NULL)

Arguments

data

A one-column matrix, data.frame, or a numeric vector.

start

A numeric that provides the time of the first observation.

end

A numeric that provides the time of the last observation.

freq

A numeric that provides the rate/frequency at which the time series is sampled. The default value is 1.

unit_ts

A string that contains the unit of measure of the time series. The default value is NULL.

unit_time

A string that contains the unit of measure of the time. The default value is NULL.

name_ts

A string that provides an identifier for the time series data. Default value is NULL.

name_time

A string that provides an identifier for the time. Default value is NULL.

data_name

A string that contains the name of the time series data.

Time

A numeric or character vector containing the times of observations. Default value is NULL. See x object in as.Date function.

time_format

A string specifiying the format of 'Time'. If not provided, 'Time' is assumed to be all integers. Default value is NULL. See format argument in as.Date function.

Value

A gts object

Author(s)

James Balamuta and Wenchao Yang

Examples

m = data.frame(rnorm(50))
x = gts(m, unit_time = 'sec', name_ts = 'example')
plot(x)

x = gen_gts(50, WN(sigma2 = 1))
x = gts(x, freq = 100, unit_time = 'sec')
plot(x)

simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.