-
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
Change in CCA object structure (saving Xbar, issue #227) #228
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Answers RFC 227 of saving the input data only once instead of having components pCCA$Fit, CCA$Xbar and CA$Xbar. This now saves Ybar (renamed from Xbar) at the top level, but does not drop other places of Fit/Xbar before support functions can handle the new structure.
Works with the RFC #227 configuration which saves only the initial input matrix. Does not yet work with dbrda.
also fixes return(NULL) for missing components
ordiYbar also works with old vegan ordination objects (without warning)
type = "working" was earlier found from eigenvectors, but now we use internal Ybar for pCCA, CCA and CA. The column dimensions change: now they are equal to the number of real dimensions like in the input data, but earlier they were equal to the number of positive eigenvalues in the component. The resulting distances are the same. Now we also have fitted for pCCA component.
The major change is that type = "response" is now found by reverting Gower double standardization on internal Ybar component. This will now also work for pCCA. Returned response is after internal standardizations and will include Cailliez or Lingoes adjustment instead of being the input. With sqrt.dist = TRUE it will also be the sqrt. This is an end of the day version subject to further testing and thinking.
now allows analysis of partial dbrda with proportional = TRUE
stressplot.dbrda works now with partial models, because we can can re-construct input dissimilarities.
This will fail in general. For instance, with only a factor constraint, fitted distances will be zero and removing adjustment will make these negative.
- the cca.object structure changed: Ybar is at the main level. At this stage, there are still redundant pCCA$Fit, CCA$Xbar and CA$Xbar items, but these will be deprecated or removed. - New Ybar structure incidentally fixes tolerance.cca which could give erroneous above-zero tolerance for species that occur only once and should have tolerance=0. The numerical precision was improved with the new Ybar version, but these wrong tolerances can still occur with useN2=TRUE when the original tolerance is nearly zero and estimated N2 is nearly one and tol/(1-N2) can be anything.
The ordination function still return pCCA$Fit, CCA$Xbar and CA$Xbar but they may be removed any time, even before the CRAN release of 2.5-0 if this looks safe. We provide function ordiYbar() that can find these items both from the new and old ordination objects.
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the
cca
family result object as discussed in issue #227. Since ever, we have saved the working data matrix in up to three places: Fitted values for conditions in$pCCA$Fit
, residual values after conditions in$CCA$Xbar
and residual values after conditions and constraints in$CA$Xbar
. Fitted values after constraints and the initial input values were not saved, but they had to be reconstructed, and reconstruction was impossible for initial values in partial db-RDA (dbrda
). This PR makes change where we only save the initial input values as working matrices ($Ybar
), and all other components can be derived from this with the provided support functionordiYbar
. The major features of this PR:$Ybar
at the top level.Xbar
andFit
items inpCCA
,CCA
andCA
components. This increases the size of the result object, and these items are marked as deprecated inman/cca.object.Rd
. However, removing these items will break CRAN package RVAideMemoire and cannot be done before consulting its maintainer.ordiYbar()
that can extract any of the old items. This function will work both with the suggested new code and old release code. UsingordiYbar()
instead of directly accessing the oldXbar
andFit
items will allow smooth working with the old result objects and maintain compatibility across vegan versions.ordiYbar
.Further issues and release plans are discussed in issue #227.