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:> 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 >
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:> 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 >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
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