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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 15 15:15:34 CEST 2009


Author: jarioksa
Date: 2009-10-15 15:15:34 +0200 (Thu, 15 Oct 2009)
New Revision: 1048

Modified:
   pkg/vegan/R/specaccum.R
   pkg/vegan/inst/ChangeLog
Log:
specaccum: smooth handling of 1-observation accumulations

Modified: pkg/vegan/R/specaccum.R
===================================================================
--- pkg/vegan/R/specaccum.R	2009-10-14 20:32:11 UTC (rev 1047)
+++ pkg/vegan/R/specaccum.R	2009-10-15 13:15:34 UTC (rev 1048)
@@ -4,7 +4,7 @@
 {
     x <- comm
     x <- as.matrix(x)
-    x <- x[, colSums(x) > 0]
+    x <- x[, colSums(x) > 0, drop=FALSE]
     n <- nrow(x)
     p <- ncol(x)
     if (p == 1) {
@@ -18,8 +18,8 @@
     METHODS <- c("collector", "random", "exact", "rarefaction", "coleman")
     method <- match.arg(method, METHODS)
     specaccum <- sdaccum <- sites <- perm <- NULL
-    if (n == 1 & method != "rarefaction")
-        stop(paste("only 1 site provided"))
+    if (n == 1 && method != "rarefaction")
+        message("No actual accumulation since only 1 site provided")
     switch(method, collector = {
         sites <- 1:n
         specaccum <- accumulator(x, sites)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-10-14 20:32:11 UTC (rev 1047)
+++ pkg/vegan/inst/ChangeLog	2009-10-15 13:15:34 UTC (rev 1048)
@@ -4,6 +4,10 @@
 
 Version 1.16-31 (opened October 3, 2009)
 
+	* specaccum: "accumulations" in one-site collections are handled
+	with a message() instead of stop()ping with error. Per request of
+	Roeland Kindt.
+
 	* constrained ordination (cca, rda, capscale) could not handle all
 	anova(.., by= "something") cases when the data were not defined by
 	data=, but were in the working environment or given using



More information about the Vegan-commits mailing list