-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backwards compatibility of adonis2() with adonis()...? #156
Comments
The deeply nested design brings along scoping issues (for instance, see 7ff1443). I rather like to see them solved. Got to see if it is possible for this issue with this design. |
At closer look, this is not only undocumented, but it is against documentation. Moreover, However, the current implementation of > with(dune, adonis2(Poatriv ~ Management*A1, data=dune.env, method="eucl"))
Error in eval(expr, envir, enclos) : object 'Poatriv' not found This works with |
adonis2 was unable to pass on 'method' and only succeeded earlier because this was hard wired to "bray". This became evident after 0989c0c. The lhs could not be evaluated similarly as in rda, dbrda and capscale. This became evident in github issue #156. The result headers need fix: use deparsed adonis2 call.
Your commit 0989c0c revealed that |
The following analyses give equal results -- and with the same RNG seed they should even give the same permutations, point to point: with(dune, anova(rda(Poatriv ~ Management*A1, data=dune.env), by="term"))
with(dune, anova(dbrda(Poatriv ~ Management*A1, data=dune.env), by="term")) # vegan 2.4-0
with(dune, anova(capscale(Poatriv ~ Management*A1, data=dune.env), by="term"))
with(dune, adonis(Poatriv ~ Management*A1, data=dune.env, method="euclid"))
with(dune, adonis2(Poatriv ~ Management*A1, data=dune.env, method="euclid")) # vegan 2.4-0 Among these, current |
I decided to release |
Although not documented,
adonis()
can be used to perform univariate permutational ANOVA:but this fails with
adonis2()
partly because
adonis0()
doesn't expect this kind of set-up and evaluates the lhs of the formula in the global environment, and notdata
. (as an aside, if weeval()
the lhs in the global environment, then isn't theenvir
argument me specify inadonis0()
not needed?)Now, that the above works at all in
adonis()
is becausevegdist()
doesn't need to do any matrix operations on the lhs because we explicitly setmethod = "euclidean"
- theadonis()
call fails with the defaultmethod = "bray"
for example.Questions:
Do we want to retain this backwards compatibility for an undocumented "feature"?
I can see a case for keeping it for
method = "euclidean"
only, for pedagogic reasons - it's nice to be able to show how the PERMANOVA relates to ANOVA in the univariate case.Assuming answer to Q1 is Yes, then we need to catch problems before they get anywhere near
vegdist()
and throw an error if the lhs is not a matrix/data frame andmethod != "euclidean"
(or the alternate spelling of that dissimilarity).If we don't want this, we need to catch univariate responses and issue a suitable error as soon as possible.
Thoughts?
The text was updated successfully, but these errors were encountered: