View source: R/ts_conversion.R
zoo_to_ts | R Documentation |
"zoo"
to "ts"
Allows for the conversion of time series objects of class "zoo"
to time series objects of class "ts"
. This is only suitable, if
the time series is observed in regular time intervals (monthly, quarterly,
yearly, etc.). The correct observation time points are then kept.
zoo_to_ts(xt)
xt |
a time series object of class |
An equidistant time series object of class "zoo"
is transformed to
class "ts"
. This is particularly useful, since most functions of this
package work with objects of class "ts"
only.
An object of class "ts"
is returned.
# Create example zoo-object
tp <- seq(from = as.Date("2020-01-01"), to = as.Date("2020-10-01"), by = "month")
xt <- zoo::zoo(1:10, order.by = tp)
xt
# Transform into ts-object
yt <- zoo_to_ts(xt)
yt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.