[R] decomposed.ts class and method

Spencer Graves spencer.graves at pdf.com
Fri Feb 10 05:50:17 CET 2006


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:

> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list