[Vegan-commits] r2601 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Sep 5 11:57:29 CEST 2013
Author: jarioksa
Date: 2013-09-05 11:57:29 +0200 (Thu, 05 Sep 2013)
New Revision: 2601
Modified:
pkg/vegan/R/MDSrotate.R
Log:
MDSrotate handles non-orthogonal designs and prepares to receive more than one external vector
Modified: pkg/vegan/R/MDSrotate.R
===================================================================
--- pkg/vegan/R/MDSrotate.R 2013-08-29 08:15:16 UTC (rev 2600)
+++ pkg/vegan/R/MDSrotate.R 2013-09-05 09:57:29 UTC (rev 2601)
@@ -36,7 +36,8 @@
}
## Rotation loop
for (k in 2:N) {
- rot <- vectorfit(x[keep, c(1,k)], vec[keep], permutations=0)$arrows
+ arrs <- vectorfit(x[keep,], vec[keep], permutations = 0)$arrows
+ rot <- arrs[c(1,k)]/sqrt(sum(arrs[c(1,k)]^2))
rot <- drop(rot)
## counterclockwise rotation matrix:
## [cos theta -sin theta]
More information about the Vegan-commits
mailing list