Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ordiplot(<rda>) passes arguments to plot.cca: fixes part of #685
Still does not handle arguments optimize and arrows when passed from ordiplot to plot.cca.
- Loading branch information
cafdc03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original issue was that you were calling
and none of those arguments are actually necessary for
NextMethod()
to work.If I
fixInNamespace("plot.rda", "vegan")
and edit theNextMethod
call to be an empty function call(Instead of your fix in this commit) I get the expected behaviour (no error from
match.call()
) and as an added bonus,optimize = TRUE
appears to work.cafdc03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh! Fine if it works, but I do not (yet) understand how it works. Please go on!
cafdc03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the call:
where
ord
is an RDA objectI think the issue is that
NextMethod()
(empty) arranges to callplot.cca()
with the original arguments, so we getYou'd get the same behaviour if you spell out the
generic
andobject
arguments explicitlywould also get you
But when you do
NextMethod("plot", x, ...)
, the...
is documented in?NextMethod
to be extra arguments to be used in the call, on top of the arguments in the original call. So, with your original codeeverything that was part of the
...
in the original call toordiplot()
will get included twice, once as a result of the normal wayNextMethod()
works and a second time because you passed...
on as extra arguments. The resulting call will beand hence the error.
NextMethod
is like dark magic and I don't really understand how it does what it does, but I'm pretty sureNextMethod()
orNextMethod("plot", x)
will fix the issue.