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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 4 17:52:22 CET 2008


Author: psolymos
Date: 2008-12-04 17:52:22 +0100 (Thu, 04 Dec 2008)
New Revision: 609

Modified:
   pkg/vegan/R/adipart.R
Log:
adipart improvement without effect on efficiency


Modified: pkg/vegan/R/adipart.R
===================================================================
--- pkg/vegan/R/adipart.R	2008-12-04 10:08:52 UTC (rev 608)
+++ pkg/vegan/R/adipart.R	2008-12-04 16:52:22 UTC (rev 609)
@@ -52,13 +52,14 @@
             wt <- lapply(1:nl, function(i) apply(tmp[[i]], 1, function(z) sum(z) / sum(matr)))
             else wt <- lapply(1:nl, function(i) rep(1 / NROW(tmp[[i]]), NROW(tmp[[i]])))
         a <- sapply(1:nl, function(i) sum(divfun(tmp[[i]]) * wt[[i]]))
-        names(a) <- c(paste("alpha", 1:(nl-1), sep="."), "gamma")
         b <- sapply(2:nl, function(i) a[i] - a[(i-1)])
-        names(b) <- paste("beta", 1:(nl-1), sep=".")
         c(a, b)
     }
     sim <- oecosimu(matr, wdivfun, method = "permat", nsimul=nsimul,
         burnin=control$burnin, thin=control$thin, control=control)
+    nam <- c(paste("alpha", 1:(nl-1), sep="."), "gamma",
+        paste("beta", 1:(nl-1), sep="."))
+    names(sim$statistic) <- attr(sim$oecosimu$statistic, "names") <- nam
     attr(sim, "index") <- index
     attr(sim, "weights") <- weights
     attr(sim, "n.levels") <- nl



More information about the Vegan-commits mailing list