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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 24 11:08:26 CEST 2010


Author: jarioksa
Date: 2010-09-24 11:08:26 +0200 (Fri, 24 Sep 2010)
New Revision: 1315

Modified:
   pkg/vegan/R/swan.R
   pkg/vegan/inst/ChangeLog
Log:
swan went to eternal loop with disconnected data

Modified: pkg/vegan/R/swan.R
===================================================================
--- pkg/vegan/R/swan.R	2010-09-23 11:00:43 UTC (rev 1314)
+++ pkg/vegan/R/swan.R	2010-09-24 09:08:26 UTC (rev 1315)
@@ -1,7 +1,8 @@
 swan <-
 function (x)
 {
-    while(any(x == 0)) {
+    zeros <- -Inf
+    while(zeros != (zeros <- sum(x == 0)) && any(x == 0)) {
         x[x > 0] <- x[x > 0] - min(x[x > 0]) + 1
         x[x == 0] <- beals(x)[x == 0]
     }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-09-23 11:00:43 UTC (rev 1314)
+++ pkg/vegan/inst/ChangeLog	2010-09-24 09:08:26 UTC (rev 1315)
@@ -4,6 +4,9 @@
 
 Version 1.18-12 (opened September 17, 2010)
 
+	* swan: no eternal loop with disconnected data where zeros will
+	remain in the matrix.
+
 	* ordilabel: gained argument 'col' to set the text colour of the
 	labels separately from 'border' (default action is to use 'border'
 	colour). 



More information about the Vegan-commits mailing list