Skip to content
Prev 359706 / 398502 Next

ts or xts with high-frequency data within a year

decompose wants frequency(Y) to be more than 1 - it really wants an integer
frequency
so it can return a vector of that length containing the repeating pattern
(the "figure").

frequency(Y) is 1/3600 so you get the error (which might be better worded):

  > plot(decompose(Y))
  Error in decompose(Y) : time series has no or less than 2 periods
  >  frequency(Y)
  [1] 0.0002777778

Use a ts object and make the frequency relative to the period of interest
(e.g., 24 for hourly
data if you are interested in the daily pattern).




Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Mar 30, 2016 at 5:37 PM, Ryan Utz <utz.ryan at gmail.com> wrote: