[Vegan-commits] r993 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 6 16:26:30 CEST 2009


Author: jarioksa
Date: 2009-09-06 16:26:28 +0200 (Sun, 06 Sep 2009)
New Revision: 993

Modified:
   pkg/vegan/R/spenvcor.R
   pkg/vegan/inst/ChangeLog
Log:
spenvcor also mixed weights() with using internal cca object structures

Modified: pkg/vegan/R/spenvcor.R
===================================================================
--- pkg/vegan/R/spenvcor.R	2009-09-06 06:17:36 UTC (rev 992)
+++ pkg/vegan/R/spenvcor.R	2009-09-06 14:26:28 UTC (rev 993)
@@ -5,9 +5,11 @@
         stop("Needs results from constrained ordination")
     u <- object$CCA$u
     wa <- object$CCA$wa
-    r <- sqrt(weights(object, "sites"))
-    u <- sweep(u, 1, r, "*")
-    wa <- sweep(wa, 1, r, "*")
+    if (!inherits(object, "rda")) { # is CCA
+        r <- sqrt(object$rowsum)
+        u <- sweep(u, 1, r, "*")
+        wa <- sweep(wa, 1, r, "*")
+    }
     diag(cor(u, wa))
 }
 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-09-06 06:17:36 UTC (rev 992)
+++ pkg/vegan/inst/ChangeLog	2009-09-06 14:26:28 UTC (rev 993)
@@ -13,6 +13,12 @@
 	data. 
 
 	* weights.cca and weights.rda know na.action.
+
+	* Fixing cca/rda functions for changes in weights(). The rule is
+	that if you can match scores() and weights(), but if you have
+	internal cca object stuctures (like x$CCA$u), you should have
+	internal weights x$rowsum. Concerns as.mlm.cca, goodness.cca,
+	permutest.cca, spenvcor.
 	
 	* plot.cca: works when there are NA values in scores.
 



More information about the Vegan-commits mailing list