[Vegan-commits] r855 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 3 15:06:48 CEST 2009


Author: jarioksa
Date: 2009-06-03 15:06:47 +0200 (Wed, 03 Jun 2009)
New Revision: 855

Modified:
   pkg/vegan/R/RsquareAdj.R
Log:
RsquareAdj for cca and rda get 'n' from the number of data rows instead of sum of ranks

Modified: pkg/vegan/R/RsquareAdj.R
===================================================================
--- pkg/vegan/R/RsquareAdj.R	2009-06-03 12:02:01 UTC (rev 854)
+++ pkg/vegan/R/RsquareAdj.R	2009-06-03 13:06:47 UTC (rev 855)
@@ -20,7 +20,7 @@
 {
     R2 <- x$CCA$tot.chi/x$tot.chi
     m <- x$CCA$rank
-    n <- 1 + m + x$CA$rank + ifelse(is.null(x$pCCA), 0, x$pCCA$rank)
+    n <- nrow(x$CCA$u)
     radj <- RsquareAdj(R2, n, m)
     list(r.squared = R2, adj.r.squared = radj)
 }
@@ -31,7 +31,7 @@
 {
     R2 <- x$CCA$tot.chi/x$tot.chi
     m <- x$CCA$rank
-    n <- 1 + m + x$CA$rank + ifelse(is.null(x$pCCA), 0, x$pCCA$rank)
+    n <- nrow(x$CCA$u)
     radj <- NA
     list(r.squared = R2, adj.r.squared = radj)
 }



More information about the Vegan-commits mailing list