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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 11 08:06:16 CEST 2012


Author: psolymos
Date: 2012-05-11 08:06:16 +0200 (Fri, 11 May 2012)
New Revision: 2163

Modified:
   pkg/vegan/R/simulate.nullmodel.R
   pkg/vegan/R/update.nullmodel.R
Log:
changing behaviour of update method

Modified: pkg/vegan/R/simulate.nullmodel.R
===================================================================
--- pkg/vegan/R/simulate.nullmodel.R	2012-05-10 15:47:26 UTC (rev 2162)
+++ pkg/vegan/R/simulate.nullmodel.R	2012-05-11 06:06:16 UTC (rev 2163)
@@ -17,7 +17,7 @@
     if (object$commsim$isSeq) {
         ## here is burnin, see update method
         if (burnin > 0)
-            update(object, burnin, ...)
+            object <- update(object, burnin, ...)
         x <- object$state
     } else {
         x <- m

Modified: pkg/vegan/R/update.nullmodel.R
===================================================================
--- pkg/vegan/R/update.nullmodel.R	2012-05-10 15:47:26 UTC (rev 2162)
+++ pkg/vegan/R/update.nullmodel.R	2012-05-11 06:06:16 UTC (rev 2163)
@@ -26,11 +26,15 @@
         state <- perm[,,1L]
         storage.mode(state) <- object$commsim$mode
         iter <- as.integer(object$iter + nsim)
-        assign("state", state, envir=object)
-        assign("iter", iter, envir=object)
-        attr(state, "iter") <- iter
+#        assign("state", state, envir=object)
+#        assign("iter", iter, envir=object)
+#        attr(state, "iter") <- iter
+        out <- nullmodel(state, object$commsim)
+        out$iter <- iter
     } else {
-        state <- NULL
+#        state <- NULL
+        out <- object
     }
-    invisible(state)
+#    invisible(state)
+    out
 }



More information about the Vegan-commits mailing list