isRegular | R Documentation |
Checks if a time series is regular.
## S4 method for signature 'timeSeries'
isDaily(x)
## S4 method for signature 'timeSeries'
isMonthly(x)
## S4 method for signature 'timeSeries'
isQuarterly(x)
## S4 method for signature 'timeSeries'
isRegular(x)
## S4 method for signature 'timeSeries'
frequency(x, ...)
x |
an R object of class 'timeSeries'. |
... |
arguments to be passed. |
What is a regular time series? If a time series is daily, monthly, or
weekly, then we speak of a regular series. This can be tested calling
the functions isDaily
, isMonthly
, isQuarterly
, or
in general isRegular
. If the series is regular then its
frequency can be determined by calling frequency
.
Here are the definitions of daily, monthly, and quarterly time series:
if the series has no more than one date/time stamp per day.
if the series has no more than one date/time stamp per month.
if the series has no more than one date/time stamp per quarter.
A regular series is either a monthly or a quarterly series.
Note that with the above definitions a monthly series is also a daily series, a quarterly series is also a monthly series. On the other hand, a daily series is not regular!
NOT yet implemented is the case of weekly series.
The is*
functions return TRUE
or FALSE
depending
on whether the series fulfills the condition or not.
frequency
returns in general 1, for quarterly series 4,
and for monthly series 12.
isRegular
frequency
data(MSFT)
isRegular(MSFT) # FALSE
frequency(MSFT) # 1
## a monthly ts
ap <- as.timeSeries(AirPassengers)
isRegular(ap) # TRUE
frequency(ap) # 12
## a quarterly ts
pres <- as.timeSeries(presidents)
isRegular(pres) # TRUE
frequency(pres) # 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.