Hello,

I have a problem programming 2 plot methods for 2 classes.
1. I have 2 classes. Each class has its own plot method. !!! How the plot,xxx-method.R -files have to look like, so that the plot method for class 1 und plot methods for class 2 can act for each belonging class. Prob

My example for "plot_class1.R" for class labeled class1 (class2 equivalent):

if (!isGeneric("plot")) {
setGeneric("plot", function(x="class1", y="ANY", ...) standardGeneric("plot"), package="the_package_name");
}

setMethod("plot", signature(x="class1", y="ANY"),
function(x, y, type="xy", method = names(x...@misclass), anno="symbol", ...)
  {
    ... #code
  }
}

#DOCS
\name{plot,class1-method}
\docType{methods}
\alias{plot}
\alias{plot,class1-method}
...


Looks it correct?
thx so far.
Dan

______________________________________________
[email protected] 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.

Reply via email to