-
Notifications
You must be signed in to change notification settings - Fork 97
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
Using anova.ccabyterm within function? #16
Comments
Not very good ideas. This is a scoping issue and scoping issues are tricky. We have slowly built up these routines so that they often work and may even work in loops or within functions. We have even some tests of scoping in vegan. However, this seems to be too deep. These are the items within
In addition, the
No
The scoping issues should be made cleaner. If you have an idea, that's fine. I can only say that you cannot do what you try to achieve. |
Thanks Jari for your comment. |
The following seems to work: Add a data frame with rhs variables in your global environment
Then edit your
NB the The problem really seems to be in |
If the intention is to recreate the data, we need to know the calling environment at the point |
The environment where the formula was created is If you look at the log of The scoping is multifaceted. You should be able to find the data when it was given in A basic problem here is that I started developing cca/rda functions long time ago (in 2001), and I did not know very well the R internals at that time (and I think I still lack knowledge in the gory entrails of R). When we hit a scoping issue, we added one new level to catch those cases. It could have been better to to redesign the interface instead of adding ad hoc over ad hoc. I have a feeling that the whole |
Thanks Jari, I just noticed this behaviour casually - no need to fix, since using the data-argument is the prefered way. |
PR #104 seems to fix this. |
I am trying to use anova.ccabyterm (but this also concerns *byaxis and *bymargin) within a function.
Example
For example using the pyrifos data and to run a RDA for every week, I could do something along these lines:
However wrapping into a function breaks:
The error throws along the lines of
model.frame.cca
. Any Ideas?The text was updated successfully, but these errors were encountered: