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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 22 08:39:27 CEST 2012


Author: jarioksa
Date: 2012-08-22 08:39:27 +0200 (Wed, 22 Aug 2012)
New Revision: 2256

Modified:
   pkg/vegan/R/density.anosim.R
   pkg/vegan/R/density.oecosimu.R
Log:
warn if density() is (wrongly) used for several terms in adonis or oecosimu

Modified: pkg/vegan/R/density.anosim.R
===================================================================
--- pkg/vegan/R/density.anosim.R	2012-08-20 16:23:51 UTC (rev 2255)
+++ pkg/vegan/R/density.anosim.R	2012-08-22 06:39:27 UTC (rev 2256)
@@ -19,6 +19,9 @@
 `density.adonis` <-
     function(x, ...)
 {
+    cols <- ncol(x$f.perms)
+    if (cols > 1)
+        warning("'density' is meaningful only with one term, you have ", cols)
     out <- density(x$f.perms, ...)
     out$call <- match.call()
     out$call[[1]] <- as.name("density")

Modified: pkg/vegan/R/density.oecosimu.R
===================================================================
--- pkg/vegan/R/density.oecosimu.R	2012-08-20 16:23:51 UTC (rev 2255)
+++ pkg/vegan/R/density.oecosimu.R	2012-08-22 06:39:27 UTC (rev 2256)
@@ -1,6 +1,9 @@
 `density.oecosimu` <-
     function(x, ...)
 {
+    cols <- nrow(x$oecosimu$simulated)
+    if (cols > 1)
+        warning("'density' is meaningful only with one statistic, you have ", cols)
     out <- density(t(x$oecosimu$simulated), ...)
     out$call <- match.call()
     out$call[[1]] <- as.name("density")



More information about the Vegan-commits mailing list