Skip to content
Prev 350232 / 398506 Next

How numerical data is stored inside ts time series objects

Use the str() function to see the internal structure of most objects.  In
your case it would show something like:
Time-Series [1:38] from 1 to 4.08: 0.8 0.9 0.1 -0.8 -1 -0.3 0.7 1 0.4 -0.5
...
ts [1:38, 1] 0.8 0.9 0.1 -0.8 -1 -0.3 0.7 1 0.4 -0.5 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr "theData"
 - attr(*, "tsp")= num [1:3] 1 4.08 12

'x' contains a vector of data and 'y' contains a 1-column matrix of data.
stl(x,"per") and stl(y, "per") give similar results as you got.

Evidently, stl() does not know that 1-column matrices can be treated much
the same as vectors and gives an error message.  Thus you must extract
the one column into a vector: stl(y[,1], "per").




Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Apr 20, 2015 at 4:04 PM, Paul <Paul.Domaskis at gmail.com> wrote: