Skip to content

decomposed.ts class and method

4 messages · Erin Hodgess, Gabor Grothendieck, Brian Ripley +1 more

#
Dear R People:

In the function "decompose", the object has the class of "decomposed.ts".
(from package stats)

I would like to see the class definition and the method for the plotting.

However, when I use
isClass("decomposed.ts")

I get "FALSE".

When I check getMethods("plot")

there is no method for plot on decomposed.ts

Any suggestions, please?

Thanks in advance!

R Version 2.2.1 Windows

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu
#
Try:

getAnywhere(plot.decomposed.ts)
getAnywhere(print.decomposed.ts) # not found; its using print.default

Also note this gives an S3 generic's methods:

methods(plot)
On 2/5/06, Erin Hodgess <hodgess at gator.dt.uh.edu> wrote:
#
This is an S3 class, not an S4 class.  (Package stats does not use S4 
classes: only package stats4 in the R tarball does.)
On Sun, 5 Feb 2006, Erin Hodgess wrote:

            

  
    
3 days later
#
Hi, Erin:

	  I tried the example in the help file for 'decompose':

      m <- decompose(co2)
      m$figure
      plot(m)

	  Consistent with your post, I got the following:

 > class(m)
[1] "decomposed.ts"

	  Then I tried the following:

 > methods(class="decomposed.ts")
[1] plot.decomposed.ts*

    Non-visible functions are asterisked

	  Then 'getAnywhere("plot.decomposed.ts")' should produce what you 
want.  Alternatively, consider the following:

 > methods("plot")
  [1] plot.acf*           plot.data.frame*    plot.Date*
  [4] plot.decomposed.ts* plot.default        plot.dendrogram*
<snip...?>

	  Thus, 'getAnywhere' should give you the plot method in this case. 
The class definition is outlined under 'Value' in the "decompose" help 
page.  For an example, try str(m).

	  hope this helps.
	  spencer graves
Erin Hodgess wrote: