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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 8 14:36:27 CEST 2009


Author: jarioksa
Date: 2009-04-08 14:36:27 +0200 (Wed, 08 Apr 2009)
New Revision: 800

Modified:
   pkg/vegan/R/adonis.R
   pkg/vegan/inst/ChangeLog
Log:
adonis uses much less memory allowing analysis of larger problems

Modified: pkg/vegan/R/adonis.R
===================================================================
--- pkg/vegan/R/adonis.R	2009-04-08 11:37:10 UTC (rev 799)
+++ pkg/vegan/R/adonis.R	2009-04-08 12:36:27 UTC (rev 800)
@@ -80,15 +80,13 @@
     ## Permutations
     if (missing(strata)) 
         strata <- NULL
-    G.p <- lapply(1:permutations, function(x) {
-        permutes <- permuted.index(n, strata = strata)
-        G[permutes, permutes]
-    } )
+    p <- sapply(1:permutations,
+                function(x) permuted.index(n, strata=strata))
     
-    ## SS.s <- sapply(G.p, function(Gs) { SS.perms(H, Gs, I) } )
+    ## Apply permutations for each term
     f.perms <- sapply(1:nterms, function(i) {
         sapply(1:permutations, function(j) {
-            f.test(H.s[[i]], G.p[[j]], I, df.Exp[i], df.Res, H.snterm)
+            f.test(H.s[[i]], G[p[,j],p[,j]], I, df.Exp[i], df.Res, H.snterm)
         } )
     })
   

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-04-08 11:37:10 UTC (rev 799)
+++ pkg/vegan/inst/ChangeLog	2009-04-08 12:36:27 UTC (rev 800)
@@ -4,6 +4,12 @@
 
 Version 1.16-17
 
+	* anosim: uses much less memory allowing analysis of larger
+	problems (number of rows, number of iterations). The change
+	concerns only internal data structures, and the permutation
+	results should be identical with old and new code when the same
+	random number seed is used. 
+
 	* meandist: a new sister function for mrpp. Function meandist
 	calculates a matrix of mean within and between group
 	dissimilarities. Its summary function returns the overall averages



More information about the Vegan-commits mailing list