Hi. I am trying to plot. In the changepoint package documentation it says something about signature. http://cran.r-project.org/web/packages/changepoint/changepoint.pdf print-methods ~~ Methods for Function print in Package 'base' ~~ Description ~~ Methods for function print in Package 'base' ~~ Methods signature(x = "ANY") Generic print function, see base package description using ?print signature(x = "cpt") Prints out information contained within the object x including a summary signature(x = "cpt.reg") Prints out information contained within the object x including a summary I don't understand what they mean by signature. For example, there is a function called binseg.mean.cusum and I want to plot the results. I tried this: binsegeeV=binseg.mean.cusum(eeV, Q=5, pen=0) plot(binsegeeV,cpt.width=3) but I get this. Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y' Anyone know how I can plot the results of binseg.mean.cusum() ? Thanks. [[alternative HTML version deleted]]
S4 generic functions dispatch on the basis of the classes of their arguments while S3 generics only dispatch on the class of the first argument. If this makes no sense to you then you need to study more in whatever text you are learning R from. Sent from my iPhone> On Mar 7, 2014, at 8:38 AM, Bill <william108 at gmail.com> wrote: > > Hi. I am trying to plot. In the changepoint package documentation it says > something about signature. > http://cran.r-project.org/web/packages/changepoint/changepoint.pdf > > print-methods ~~ Methods for Function print in Package 'base' ~~ > Description > ~~ Methods for function print in Package 'base' ~~ > Methods > signature(x = "ANY") Generic print function, see base package description > using ?print > signature(x = "cpt") Prints out information contained within the object x > including a summary > signature(x = "cpt.reg") Prints out information contained within the object > x including a > summary > > I don't understand what they mean by signature. For example, there is a > function called > binseg.mean.cusum > > and I want to plot the results. > I tried this: > binsegeeV=binseg.mean.cusum(eeV, Q=5, pen=0) > > plot(binsegeeV,cpt.width=3) > > but I get this. > Error in xy.coords(x, y, xlabel, ylabel, log) : > 'x' is a list, but does not have components 'x' and 'y' > > Anyone know how I can plot the results of binseg.mean.cusum() ? > Thanks. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
I'm going to assume that the binseg.mean.cumsum() function is from the changepoint package. I don't know any details about this function or package, so I'm going to make a suggestion based in basic R principles. I'd suggest that for the time being you ignore whatever it is that the changepoint documentation says about signatures, and instead do this: class(binsegeeV) If the changepoint package includes a method for plotting objects of that class, then plot(binsegeeV) should produce a plot. It did not, which implies that the package does not include a method. Is there something in the package documentation that suggests a plot function is provided? Apparently, you'll have to figure out for yourself how to plot such an object. Which might be easy, depending on what structure of binsegeeV is, and what kind of plot you want. (Unfortunately, I can't help with that) The one caveat I have is that perhaps the package has some plotting capability for the output of binseg.mean.cumsum(), but there's something else you have to do to make it work. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/6/14 5:38 PM, "Bill" <william108 at gmail.com> wrote:>Hi. I am trying to plot. In the changepoint package documentation it says >something about signature. >http://cran.r-project.org/web/packages/changepoint/changepoint.pdf > >print-methods ~~ Methods for Function print in Package 'base' ~~ >Description >~~ Methods for function print in Package 'base' ~~ >Methods >signature(x = "ANY") Generic print function, see base package description >using ?print >signature(x = "cpt") Prints out information contained within the object x >including a summary >signature(x = "cpt.reg") Prints out information contained within the >object >x including a >summary > >I don't understand what they mean by signature. For example, there is a >function called >binseg.mean.cusum > >and I want to plot the results. >I tried this: >binsegeeV=binseg.mean.cusum(eeV, Q=5, pen=0) > >plot(binsegeeV,cpt.width=3) > >but I get this. >Error in xy.coords(x, y, xlabel, ylabel, log) : > 'x' is a list, but does not have components 'x' and 'y' > >Anyone know how I can plot the results of binseg.mean.cusum() ? >Thanks. > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.