as_ts | R Documentation |
Transforms a ts_data
object into a standard R ts
(time series) object.
as_ts(ts)
ts |
A |
The function preserves the original time indices and frequency of the input ts_data
.
It calculates the deltat
based on the time vector t
in ts_data
.
A ts
object representing the same time series as the input ts_data
.
# Create a ts_data object with a linear trend
ts_obj <- ts_data(12, trend.coeff = c(sample(0:10, 1), sample(1 + (1:10)/20, 1)))
# Convert to standard ts object
ts_standard <- as_ts(ts_obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.