I understand that breaking code is a problem, and that is admittedly the
main reason not to immediately adopt my suggestion.
But as a purely logical exercise, creating a "PCA" object X or something
similar and using either
plot(X)
or
plot(as.PCA(mySpecialObject))
is a much more sensible use of object-oriented programming/design. This
requires no new generics (to write or to learn).
And you could use it to transition away from the current system by
convincing the various package maintainers to re-implement plotPCA as
follows:
plotPCA <- function(object, ...) {
plot(as.PCA(object), ...)
}
This would be relatively easy to eventually deprecate and teach users to
switch to the alternative.
On 10/20/2014 1:07 PM, Michael Love wrote:
hi Kevin,
that would imply there is only one way to plot an object of a given
class. Additionally, it would break a lot of code.?
best,
Mike
On Mon, Oct 20, 2014 at 12:50 PM, Kevin Coombes <kevin.r.coombes at gmail.com
But shouldn't they all really just be named "plot" for the appropriate
objects? In which case, there would already be a perfectly good generic....
On Oct 20, 2014 10:27 AM, "Michael Love" <michaelisaiahlove at gmail.com>
wrote:
I noticed that 'plotPCA' functions are defined in EDASeq, DESeq2,
DESeq,
affycoretools, Rcade, facopy, CopyNumber450k, netresponse, MAIT (maybe
more).
Sounds like a case for BiocGenerics.
best,
Mike
[[alternative HTML version deleted]]