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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 21 09:32:57 CEST 2010


Author: jarioksa
Date: 2010-07-21 09:32:57 +0200 (Wed, 21 Jul 2010)
New Revision: 1243

Modified:
   pkg/vegan/R/decorana.R
   pkg/vegan/inst/ChangeLog
Log:
change order of test: detect non-numeric data before negative entries

Modified: pkg/vegan/R/decorana.R
===================================================================
--- pkg/vegan/R/decorana.R	2010-07-20 14:14:08 UTC (rev 1242)
+++ pkg/vegan/R/decorana.R	2010-07-21 07:32:57 UTC (rev 1243)
@@ -6,10 +6,10 @@
     Const2 <- 5
     Const3 <- 1e-11
     veg <- as.matrix(veg)
+    if (any(rowSums(veg) <= 0)) 
+        stop("All row sums must be >0 in the community matrix: remove empty sites.")
     if (any(veg < 0))
         stop("'decorana' cannot handle negative data entries")
-    if (any(rowSums(veg) <= 0)) 
-        stop("All row sums must be >0 in the community matrix: remove empty sites.")
     if (any(colSums(veg) <= 0)) 
         warning("Some species were removed because they were missing in the data.")
     nr <- nrow(veg)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-07-20 14:14:08 UTC (rev 1242)
+++ pkg/vegan/inst/ChangeLog	2010-07-21 07:32:57 UTC (rev 1243)
@@ -14,6 +14,9 @@
 	ordilabel() with draw == "polygon" (but still text() with draw ==
 	"lines"). 
 
+	decorana: change order of data checks so that non-numeric data is
+	detected (by rowSums()) before checking negative data entries. 
+
 Version 1.18-7 (closed July 19, 2010)
 
 	* new version opened with the release of vegan_1.17-3.



More information about the Vegan-commits mailing list