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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 25 11:22:56 CEST 2010


Author: jarioksa
Date: 2010-08-25 11:22:56 +0200 (Wed, 25 Aug 2010)
New Revision: 1280

Modified:
   pkg/vegan/R/deviance.cca.R
   pkg/vegan/R/deviance.rda.R
   pkg/vegan/inst/ChangeLog
Log:
deviance.cca/rda return 0 if there is residual component

Modified: pkg/vegan/R/deviance.cca.R
===================================================================
--- pkg/vegan/R/deviance.cca.R	2010-08-25 09:10:50 UTC (rev 1279)
+++ pkg/vegan/R/deviance.cca.R	2010-08-25 09:22:56 UTC (rev 1280)
@@ -1,2 +1,8 @@
-"deviance.cca" <-
-function(object, ...) object$CA$tot.chi * object$grand.tot
+`deviance.cca` <-
+    function(object, ...)
+{
+    if (is.null(object$CA))
+        0
+    else
+        object$CA$tot.chi * object$grand.tot
+}

Modified: pkg/vegan/R/deviance.rda.R
===================================================================
--- pkg/vegan/R/deviance.rda.R	2010-08-25 09:10:50 UTC (rev 1279)
+++ pkg/vegan/R/deviance.rda.R	2010-08-25 09:22:56 UTC (rev 1280)
@@ -1,2 +1,8 @@
-"deviance.rda" <-
-function(object, ...) object$CA$tot.chi * (nrow(object$CA$Xbar) - 1)
+`deviance.rda` <-
+    function(object, ...)
+{
+    if (is.null(object$CA))
+        0
+    else
+        object$CA$tot.chi * (nrow(object$CA$Xbar) - 1)
+}

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-08-25 09:10:50 UTC (rev 1279)
+++ pkg/vegan/inst/ChangeLog	2010-08-25 09:22:56 UTC (rev 1280)
@@ -7,6 +7,9 @@
 	* New version opened with the release of vegan_1.17-4 on August
 	20, 2010.
 
+	* deviance.cca/rda: return 0 (instead of NULL) if there is no
+	residual variation.
+
 	* vegdist: help page gives equations for binary variants of the
 	indices. 
 



More information about the Vegan-commits mailing list