[Vegan-commits] r1219 - in branches/1.17: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 6 17:44:10 CEST 2010


Author: jarioksa
Date: 2010-06-06 17:44:09 +0200 (Sun, 06 Jun 2010)
New Revision: 1219

Modified:
   branches/1.17/R/postMDS.R
   branches/1.17/R/tsallis.R
   branches/1.17/inst/ChangeLog
Log:
merge small fixes in tsallis & postMDS

Modified: branches/1.17/R/postMDS.R
===================================================================
--- branches/1.17/R/postMDS.R	2010-06-06 09:13:01 UTC (rev 1218)
+++ branches/1.17/R/postMDS.R	2010-06-06 15:44:09 UTC (rev 1219)
@@ -39,7 +39,7 @@
         }
     }
     if (!halfchange) {
-        scl <- max(dist)/max(vegdist(x, "euclidean"))
+        scl <- max(dist, na.rm = TRUE)/max(vegdist(x, "euclidean"))
         x <- x*scl
     }
     if (plot && halfchange) {

Modified: branches/1.17/R/tsallis.R
===================================================================
--- branches/1.17/R/tsallis.R	2010-06-06 09:13:01 UTC (rev 1218)
+++ branches/1.17/R/tsallis.R	2010-06-06 15:44:09 UTC (rev 1219)
@@ -21,10 +21,10 @@
         }
         else {
             if (scales[a] == 1) result[, a] <- diversity(x, "shannon")
-            if (scales[a] == 0) result[, a] <- apply(x > 0, 1, function(y) sum(y) - 1)
+            if (scales[a] == 0) result[, a] <- rowSums(x > 0) - 1
         }
         if (norm) {
-            ST <- apply(x > 0, 1, sum)
+            ST <- rowSums(x > 0)
             if (scales[a] == 1) result[, a] <- result[, a] / log(ST)
             else result[, a] <- result[, a] / ((ST^(1-scales[a]) - 1) / (1 - scales[a]))
         }

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-06-06 09:13:01 UTC (rev 1218)
+++ branches/1.17/inst/ChangeLog	2010-06-06 15:44:09 UTC (rev 1219)
@@ -4,8 +4,10 @@
 
 Version 1.17-3 (not yet released)
 
-	* merged r1210:1213: mantel and mantel.partial speed-ups.
+	* merge r1211:1213: mantel and mantel.partial speed-ups.
 
+	* merge r1210: tsallis a bit faster.
+
 	* merge r1200: cca, rda failed when Condition() was a factor, but
 	constraints had no factors.
 	
@@ -13,6 +15,8 @@
 
 	* merge r1188: ordiresids de-weights *CA.
 
+	* merge r1185: metaMDS handles NA distances.
+
 	* merge r1182 (r1184 for Rd) r1187: mantel.correlog upgrades.
 
 	* merge r1181: RsquareAdj.rda used wrong df in rank-deficit



More information about the Vegan-commits mailing list