[Picante-commits] r75 - branches/gsoc/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 29 01:16:47 CEST 2008


Author: mrhelmus
Date: 2008-05-29 01:16:47 +0200 (Thu, 29 May 2008)
New Revision: 75

Modified:
   branches/gsoc/R/specaccum.PSR.r
Log:
Fixed bug: the code now works for quadrats sampled for the first few permutations that have species richness<2.   

Modified: branches/gsoc/R/specaccum.PSR.r
===================================================================
--- branches/gsoc/R/specaccum.PSR.r	2008-05-28 20:57:35 UTC (rev 74)
+++ branches/gsoc/R/specaccum.PSR.r	2008-05-28 23:16:47 UTC (rev 75)
@@ -30,7 +30,9 @@
   perm <- array(dim = c(n, permutations))
   for (i in 1:permutations)
   {
-    perm[, i] <- accumulator(x, sample(n),Cmatrix)
+    r.x=0
+    while(length(r.x)<n){r.x <- accumulator(x, sample(n),Cmatrix)}
+    perm[, i]<-r.x
   }
   sites <- 1:n
   specaccum <- apply(perm, 1, mean)



More information about the Picante-commits mailing list