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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 9 12:30:03 CEST 2009


Author: jarioksa
Date: 2009-06-09 12:30:00 +0200 (Tue, 09 Jun 2009)
New Revision: 862

Modified:
   pkg/vegan/R/RsquareAdj.R
   pkg/vegan/inst/ChangeLog
Log:
It is not clear how adjusted R2 is defefined in RsquareAdj.rda for partial models, and hence it is always NA for those

Modified: pkg/vegan/R/RsquareAdj.R
===================================================================
--- pkg/vegan/R/RsquareAdj.R	2009-06-09 09:28:08 UTC (rev 861)
+++ pkg/vegan/R/RsquareAdj.R	2009-06-09 10:30:00 UTC (rev 862)
@@ -21,7 +21,10 @@
     R2 <- x$CCA$tot.chi/x$tot.chi
     m <- x$CCA$rank
     n <- nrow(x$CCA$u)
-    radj <- RsquareAdj(R2, n, m)
+    if (is.null(x$pCCA))
+        radj <- RsquareAdj(R2, n, m)
+    else
+        radj <- NA
     list(r.squared = R2, adj.r.squared = radj)
 }
 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-06-09 09:28:08 UTC (rev 861)
+++ pkg/vegan/inst/ChangeLog	2009-06-09 10:30:00 UTC (rev 862)
@@ -21,7 +21,8 @@
 	* wcmdscale: remove zero eigenvalues, keep negative, and do not
 	assume that the last eigenvalue is zero. 
 
-	* RsquareAdj.cca: returns R2, but no adjusted R2 (which is NA). 
+	* RsquareAdj: 'cca' returns R2, but no adjusted R2 (which is
+	NA). The adjusted R2 is always NA for partial models. 
 
 	* kendall.global: fixed a bug that caused incorrect counts of ties
 	in large data sets.



More information about the Vegan-commits mailing list