[Vegan-commits] r1895 - in pkg/vegan: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 26 14:57:32 CEST 2011


Author: jarioksa
Date: 2011-09-26 14:57:32 +0200 (Mon, 26 Sep 2011)
New Revision: 1895

Modified:
   pkg/vegan/R/oecosimu.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/oecosimu.Rd
Log:
fix simmat method name, and also accept nullmodel as the first ('comm') argument

Modified: pkg/vegan/R/oecosimu.R
===================================================================
--- pkg/vegan/R/oecosimu.R	2011-09-26 12:55:18 UTC (rev 1894)
+++ pkg/vegan/R/oecosimu.R	2011-09-26 12:57:32 UTC (rev 1895)
@@ -18,13 +18,19 @@
     if (inherits(comm, "simmat")) {
         x <- comm
         comm <- attr(comm, "data")
-        method <- attr(comm, "method")
+        method <- attr(x, "method")
         simmat_in <- TRUE
-    } else simmat_in <- FALSE
-
-    nm <- nullmodel(comm, method)
-    if (nm$commsim$binary)
-        comm <- ifelse(comm > 0, 1L, 0L)
+    } else {
+        simmat_in <- FALSE
+        if (inherits(comm, "nullmodel")) {
+            nm <- comm
+            comm <- comm$data
+        } else {
+            nm <- nullmodel(comm, method)
+            if (nm$commsim$binary)
+                comm <- nm$data
+        }
+    }
     
     ind <- nestfun(comm, ...)
     indstat <-

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-09-26 12:55:18 UTC (rev 1894)
+++ pkg/vegan/inst/ChangeLog	2011-09-26 12:57:32 UTC (rev 1895)
@@ -4,9 +4,12 @@
 
 Version 2.1-1 (opened September 20, 2011)
 
-	* oecosimu can take a simmat object as comm argument,
-	so different statistics can be swept out based on the
-	same set of permuted matrices.
+	* oecosimu: the 'comm' argument can be either 1) community data,
+	2) a nullmodel object or 3) a simmat object. If 'comm' is a
+	nullmodel, simulation method is found from the nullmodel object,
+	and if 'comm' is a simmat object, its matrices are analysed
+	without simulations within oecosimu(), and different statistics
+	can be swept out based on the same set of simulated matrices.
 
 	* permatfull/swap is using the new simulate(nullmodel(...)...)
 	infrastructure. permatfull1 and permatswap1 removed from vegan 

Modified: pkg/vegan/man/oecosimu.Rd
===================================================================
--- pkg/vegan/man/oecosimu.Rd	2011-09-26 12:55:18 UTC (rev 1894)
+++ pkg/vegan/man/oecosimu.Rd	2011-09-26 12:57:32 UTC (rev 1895)
@@ -7,7 +7,7 @@
 \alias{density.oecosimu}
 \alias{densityplot.oecosimu}
 
-\title{ Null Models for Biological Communities }
+\title{Evaluate Statistics with Null Models of Biological Communities }
 
 \description{
   Null models generate random communities with different criteria to
@@ -29,8 +29,15 @@
 }
 
 \arguments{
-  \item{comm}{Community data, or an object of class \code{simmat} (array 
-    of permuted matrices from \code{\link{simulate.nullmodel}}).}
+  \item{comm}{Community data, or a Null model object generated by
+    \code{\link{nullmodel}} or an object of class \code{simmat} (array
+    of permuted matrices from \code{\link{simulate.nullmodel}}). If
+    \code{comm} is a community data, null model simulation
+    \code{method} must be specified.  If \code{comm} is a
+    \code{\link{nullmodel}}, the simulation \code{method} is ignored,
+    and if \code{comm} is a \code{simmat} object, all other arguments
+    are ignored except \code{nestfun}, \code{statistic} and
+    \code{alternative}.}
   \item{x}{Community data for \code{commsimulator}, or an \code{oecosimu}
     result object for \code{as.ts}, \code{as.mcmc}, \code{density} and 
     \code{densityplot}.}
@@ -41,13 +48,19 @@
   \code{statistic}. See Examples for defining your own functions.}
   \item{method}{Null model method: either a name (character string) of
     a method defined in \code{\link{make.commsim}} or a
-    \code{\link{commsim}} function. See Details and Examples.}
-  \item{nsimul}{Number of simulated null communities.}
+    \code{\link{commsim}} function. This argument is ignored if
+    \code{comm} is a \code{\link{nullmodel}} or a \code{simmat}
+    object. See Details and Examples.}
+  \item{nsimul}{Number of simulated null communities (ignored if
+    \code{comm} is a \code{simmat} object.}
   \item{burnin}{Number of null communities discarded before proper
-  analysis in sequential methods \code{"swap"} and \code{"tswap"}.}
+    analysis in sequential methods \code{"swap"} and \code{"tswap"}
+    (ignored with non-sequential methods or when \code{comm} is a
+    \code{simmat} object.}
   \item{thin}{Number of discarded null communities between two
-  evaluations of nestedness statistic in sequential methods
-  \code{"swap"} and \code{"tswap"}.}
+    evaluations of nestedness statistic in sequential methods
+    \code{"swap"} and \code{"tswap"} (ignored with non-sequential
+    methods or when \code{comm} is a \code{simmat} object.}
   \item{statistic}{The name of the statistic returned by
     \code{nestedfun}} 
   \item{alternative}{a character string specifying the alternative



More information about the Vegan-commits mailing list