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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 5 17:23:14 CEST 2011


Author: jarioksa
Date: 2011-10-05 17:23:12 +0200 (Wed, 05 Oct 2011)
New Revision: 1933

Modified:
   pkg/vegan/R/oecosimu.R
Log:
fix version check, and check against one-simulation 'simmat'

Modified: pkg/vegan/R/oecosimu.R
===================================================================
--- pkg/vegan/R/oecosimu.R	2011-10-05 13:18:05 UTC (rev 1932)
+++ pkg/vegan/R/oecosimu.R	2011-10-05 15:23:12 UTC (rev 1933)
@@ -17,9 +17,11 @@
 
     if (inherits(comm, "simmat")) {
         x <- comm
-        comm <- attr(comm, "data")
         method <- attr(x, "method")
         nsimul <- dim(x)[3]
+        if (nsimul == 1)
+            stop("only one simulation in ", sQuote(deparse(substitute(comm))))
+        comm <- attr(comm, "data")
         simmat_in <- TRUE
     } else {
         simmat_in <- FALSE
@@ -55,7 +57,7 @@
     }
 
     ## socket cluster if parallel > 1 (and we can do this)
-    if (parallel > 1 && getRversion() > "2.14" && require(parallel)) {
+    if (parallel > 1 && getRversion() >= "2.14" && require(parallel)) {
         oecoClus <- makePSOCKcluster(as.integer(parallel))
         ## make vegan functions available: others may be unavailable
         clusterEvalQ(oecoClus, library(vegan))



More information about the Vegan-commits mailing list