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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 26 10:44:54 CET 2012


Author: jarioksa
Date: 2012-01-26 10:43:59 +0100 (Thu, 26 Jan 2012)
New Revision: 2052

Modified:
   pkg/vegan/R/varpart2.R
   pkg/vegan/R/varpart3.R
   pkg/vegan/R/varpart4.R
   pkg/vegan/inst/ChangeLog
Log:
do not scale constraints in varpart

Modified: pkg/vegan/R/varpart2.R
===================================================================
--- pkg/vegan/R/varpart2.R	2012-01-22 18:08:58 UTC (rev 2051)
+++ pkg/vegan/R/varpart2.R	2012-01-26 09:43:59 UTC (rev 2052)
@@ -15,8 +15,8 @@
     if (n2 != n) 
         stop("Y and X2 do not have the same number of rows")
     Y <- scale(Y, center = TRUE, scale = FALSE)
-    X1 <- scale(X1)
-    X2 <- scale(X2)
+    X1 <- scale(X1, center = TRUE, scale = FALSE)
+    X2 <- scale(X2, center = TRUE, scale = FALSE)
     SS.Y <- sum(Y * Y)
     dummy <- simpleRDA2(Y, X1, SS.Y, mm1)
     ab.ua <- dummy$Rsquare

Modified: pkg/vegan/R/varpart3.R
===================================================================
--- pkg/vegan/R/varpart3.R	2012-01-22 18:08:58 UTC (rev 2051)
+++ pkg/vegan/R/varpart3.R	2012-01-26 09:43:59 UTC (rev 2052)
@@ -20,9 +20,9 @@
     if (n3 != n) 
         stop("Y and X3 do not have the same number of rows")
     Y <- scale(Y, center = TRUE, scale = FALSE)
-    X1 <- scale(X1, center = TRUE, scale = TRUE)
-    X2 <- scale(X2, center = TRUE, scale = TRUE)
-    X3 <- scale(X3, center = TRUE, scale = TRUE)
+    X1 <- scale(X1, center = TRUE, scale = FALSE)
+    X2 <- scale(X2, center = TRUE, scale = FALSE)
+    X3 <- scale(X3, center = TRUE, scale = FALSE)
     SS.Y <- sum(Y * Y)
     dummy <- simpleRDA2(Y, X1, SS.Y, mm1)
     adfg.ua <- dummy$Rsquare

Modified: pkg/vegan/R/varpart4.R
===================================================================
--- pkg/vegan/R/varpart4.R	2012-01-22 18:08:58 UTC (rev 2051)
+++ pkg/vegan/R/varpart4.R	2012-01-26 09:43:59 UTC (rev 2052)
@@ -25,10 +25,10 @@
     if (n4 != n) 
         stop("Y and X4 do not have the same number of rows")
     Y <- scale(Y, center = TRUE, scale = FALSE)
-    X1 <- scale(X1, center = TRUE, scale = TRUE)
-    X2 <- scale(X2, center = TRUE, scale = TRUE)
-    X3 <- scale(X3, center = TRUE, scale = TRUE)
-    X4 <- scale(X4, center = TRUE, scale = TRUE)
+    X1 <- scale(X1, center = TRUE, scale = FALSE)
+    X2 <- scale(X2, center = TRUE, scale = FALSE)
+    X3 <- scale(X3, center = TRUE, scale = FALSE)
+    X4 <- scale(X4, center = TRUE, scale = FALSE)
     SS.Y <- sum(Y * Y)
     dummy <- simpleRDA2(Y, X1, SS.Y)
     aeghklno.ua <- dummy$Rsquare

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-01-22 18:08:58 UTC (rev 2051)
+++ pkg/vegan/inst/ChangeLog	2012-01-26 09:43:59 UTC (rev 2052)
@@ -5,6 +5,12 @@
 Vegan 2.1-10 (opened January 22, 2012)
 
 	* mantel, mantel.partial: implemented parallel processing.
+
+	* varpart: do not scale constraints to unit sd -- this makes
+	constant columns (like all zero) into NaN and causes an error in
+	simpleRDA2.  Not scaling may help in problems like that reported
+	in "[vegan-help][5477] Nested factors in function "varpart"?" by
+	Katie Shelef on 26 Jan 2012
 	
 Version 2.1-9 (closed January 22, 2012)
 



More information about the Vegan-commits mailing list