[Vegan-commits] r1507 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Feb 23 10:37:52 CET 2011
Author: jarioksa
Date: 2011-02-23 10:37:51 +0100 (Wed, 23 Feb 2011)
New Revision: 1507
Modified:
pkg/vegan/R/specaccum.R
Log:
specaccum failed when 'w' was not given
Modified: pkg/vegan/R/specaccum.R
===================================================================
--- pkg/vegan/R/specaccum.R 2011-02-23 05:48:02 UTC (rev 1506)
+++ pkg/vegan/R/specaccum.R 2011-02-23 09:37:51 UTC (rev 1507)
@@ -32,7 +32,8 @@
weights <- array(dim = c(n, permutations))
for (i in 1:permutations) {
perm[, i] <- accumulator(x, ord <- sample(n))
- weights[,i] <- cumsum(w[ord])
+ if(!is.null(w))
+ weights[,i] <- cumsum(w[ord])
}
sites <- 1:n
specaccum <- apply(perm, 1, mean)
More information about the Vegan-commits
mailing list