[Vegan-commits] r2086 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 13 13:45:03 CET 2012


Author: jarioksa
Date: 2012-02-13 13:45:03 +0100 (Mon, 13 Feb 2012)
New Revision: 2086

Modified:
   pkg/vegan/R/simper.R
Log:
colMeans is faster than apply

Modified: pkg/vegan/R/simper.R
===================================================================
--- pkg/vegan/R/simper.R	2012-02-12 07:55:17 UTC (rev 2085)
+++ pkg/vegan/R/simper.R	2012-02-13 12:45:03 UTC (rev 2086)
@@ -52,7 +52,7 @@
                 contr[(j-1)*n.a+k, ] <- md / sum(me)	
             }
         }
-        av.contr <- apply(contr, 2, mean) * 100
+        av.contr <- colMeans(contr) * 100
         ov.av.dis <- sum(av.contr)
         sdi <- apply(contr, 2, sd)
         sdi.av <- av.contr / sdi



More information about the Vegan-commits mailing list