Skip to content
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

Fix (remaining?) scoping issues #104

Merged
merged 5 commits into from
Feb 28, 2015

Conversation

jarioksa
Copy link
Contributor

After this PR, tests/vegan-tests.R do not fail in scoping issues. Two things were fixed:

  1. ordiParseFormula evaluates models slightly differently when the terms are given in data= (which used to work) and when they are in atttached data frame or in global environment (which often failed). This also seems to fix cases where the terms in global environment had the same names as functions.
  2. capscale calculated new data and updated formula within the function when calling ordiParseFormula, and the environment of the updated formula vanished after exiting or could not be scoped properly in embedded capscale. Now formula is evaluated in more standard ways.

The anova.ccabymargin and anova.ccabyterm still fail in tests/vegan-tests.R because we have not yet implemented handling of missing values in these functions.

This seems to fix issues #16 and #100

Jari Oksanen added 5 commits February 26, 2015 13:42
Fixes most things in scoping of constraints and conditions,
but breaks conditional dbRDA (capscale).
capscale updated formula with a new data calculated within the
function, and the environmental of the formula vanished after
exiting. This could cause problems when the result was reused in
anova.cca etc, or when capscale was embedded in other functions.

tests/vegan-tests.R failed in all capscale cases before this fix.
All #FIXME# cases work now. These were about capscale, but
work after 41847c6. Tests with anova.ccabyterm and
anova.ccabymargin still fail because these functions refuse
to handle missing values.
jarioksa pushed a commit that referenced this pull request Feb 28, 2015
Fix (remaining?) scoping issues
@jarioksa jarioksa merged commit d8e45f1 into vegandevs:master Feb 28, 2015
@jarioksa jarioksa added this to the v2.2-2 milestone Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant