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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 21 20:35:21 CEST 2014


Author: jarioksa
Date: 2014-04-21 20:35:21 +0200 (Mon, 21 Apr 2014)
New Revision: 2868

Modified:
   pkg/vegan/NAMESPACE
   pkg/vegan/R/RsquareAdj.R
   pkg/vegan/inst/ChangeLog
Log:
disable RsquareAdj for capscale with imaginary inertia

Modified: pkg/vegan/NAMESPACE
===================================================================
--- pkg/vegan/NAMESPACE	2014-03-29 23:12:50 UTC (rev 2867)
+++ pkg/vegan/NAMESPACE	2014-04-21 18:35:21 UTC (rev 2868)
@@ -84,6 +84,7 @@
 S3method(RsquareAdj, glm)
 S3method(RsquareAdj, lm)
 S3method(RsquareAdj, rda)
+S3method(RsquareAdj, capscale)
 # TukeyHSD: stats
 S3method(TukeyHSD, betadisper)
 # add1: stats

Modified: pkg/vegan/R/RsquareAdj.R
===================================================================
--- pkg/vegan/R/RsquareAdj.R	2014-03-29 23:12:50 UTC (rev 2867)
+++ pkg/vegan/R/RsquareAdj.R	2014-04-21 18:35:21 UTC (rev 2868)
@@ -33,6 +33,19 @@
     list(r.squared = R2, adj.r.squared = radj)
 }
 
+## dbRDA: Euclidean style distances with no imaginary component can be
+## handled as rda, but I have no idea how to handle objects with
+## imaginary inertia.
+
+`RsquareAdj.capscale` <-
+    function(x, ...)
+{
+    if (!is.null(x$CA$imaginary.chi))
+        list(r.squared = NA, adj.r.squared = NA)
+    else
+        NextMethod("RsquareAdj", x, ...)
+}
+
 ## cca result: no RsquareAdj
 RsquareAdj.cca <-
     function(x, ...)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2014-03-29 23:12:50 UTC (rev 2867)
+++ pkg/vegan/inst/ChangeLog	2014-04-21 18:35:21 UTC (rev 2868)
@@ -57,6 +57,10 @@
 	for these cases as well, and radfit.data.frame() completely
 	removes empty rows from the data (with a warning).
 
+	* RsquareAdj: return list(NA, NA) for capscale objects with
+	imaginary component, and use rda method if there is no imaginary
+	component. 
+
 	* tabasco: "hclust" objects (use, sp.ind) are reordered using
 	weighted means. This is a better method than the unweighted means
 	used for reordering of dendrograms. Earlier "hclust" objects were



More information about the Vegan-commits mailing list