Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
I have now implemented a first sweep on basing all constrained ordination methods in shared code. The major merges to master are
ordConstrainedinfrastructureccarda, first steprda, second step + support functionscapscaledbrdaand downgrading ofcapscale(issue #217)The general idea is that all these functions (
cca,rda,capscaleanddbrda) are very similar with the following major differences:Inertia is defined and data are initialized in different ways. In
rdathe inertia is variance or standardized variances (correlations), inccainertia is derived from Chi-square and data are double-standardized, indbrdainertia is based on squared dissimilarities and dissimilarity data are Gower double-centred, and incapscalethe dissimilarities are mapped onto Euclidean coordinates and analysed like inrda.ccais double-standardized and we need to handle row and column weights unlike in other methods.dbrdais based on eigen decomposition of symmetric data, but other methods on singular value decomposition of rectangular data.There are no other differences.
The new functions should appear nearly unchanged to the user. There is one known issue that has not be implemented yet: handling of zero-rank components. However, possible new problems only crop out in use. I hope many people haven on opportunity to try and tease these new functions to fix the problems prior the CRAN release.
The new infrastructure is cleaner, more consistent among methods and more easily maintained (it is also somewhat faster for some methods). It is also more easily extended to new analyses. It would also be very simple to change the name of the ordination components from
pCCA,CCAandCAtoPartial,ConstrainedandUnconstrainedlike @gavinsimpson suggested in issue #207.There may be still opportunity to clean up. Currently the final result objects are built with separate layers:
ordConstrainedbuilds and returns the basic ordination structure.ordConstrainedis called by old functions and these add items to the data: information ofNAhandling, missing species, centroids of factor variables if formula interface was used etc. Theman/cca.object.Rdfiles still looks unnecessarily complicated, and several of its items are not derived fromordConstrained.Currently
ordConstrainedis exported, and it could be used by a knowledgeable user in the same way aslm.fitcan be used instead oflm(please read?lm.fitto see the difference). I don't know ifordConstrainedshould be visible or made non-exported function. That is open to discussion.