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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 24 19:45:15 CET 2009


Author: psolymos
Date: 2009-02-24 19:45:15 +0100 (Tue, 24 Feb 2009)
New Revision: 703

Added:
   pkg/vegan/R/lag.plot.permat.R
Modified:
   pkg/vegan/man/permatfull.Rd
Log:
lag.plot.permat added to diagnose independence


Added: pkg/vegan/R/lag.plot.permat.R
===================================================================
--- pkg/vegan/R/lag.plot.permat.R	                        (rev 0)
+++ pkg/vegan/R/lag.plot.permat.R	2009-02-24 18:45:15 UTC (rev 703)
@@ -0,0 +1,17 @@
+`lag.plot.permat` <-
+function(x, type = "bray", ...)
+{
+    type <- match.arg(type, c("bray", "chisq"))
+    ## this duality is required, because ylab can not be specified for lag.plot
+    switch(type,
+        "bray" = {
+            out <- Bray.Curtis.Dissimilarities <- summary(x)[[type]]
+            lag.plot(Bray.Curtis.Dissimilarities, ...)
+        },
+        "chisq" = {
+            out <- Chi.Squared.Values <- summary(x)[[type]]
+            lag.plot(Chi.Squared.Values, ...)
+        })
+#    lag.plot(summary(x)[[match.arg(type, c("bray", "chisq"))]], ...)
+    invisible(out)
+}

Modified: pkg/vegan/man/permatfull.Rd
===================================================================
--- pkg/vegan/man/permatfull.Rd	2009-02-24 18:16:06 UTC (rev 702)
+++ pkg/vegan/man/permatfull.Rd	2009-02-24 18:45:15 UTC (rev 703)
@@ -5,6 +5,7 @@
 \alias{permat.control}
 \alias{plot.permat}
 \alias{lines.permat}
+\alias{lag.plot.permat}
 \alias{print.permat}
 \alias{summary.permat}
 \alias{print.summary.permat}
@@ -28,6 +29,7 @@
 \method{plot}{permat}(x, type = "bray", ylab, xlab, col, lty,
 lowess = TRUE, plot = TRUE, text = TRUE, ...)
 \method{lines}{permat}(x, type = "bray", ...)
+lag.plot.permat(x, type = "bray", ...)
 \method{summary}{permat}(object, ...)
 \method{print}{summary.permat}(x, digits = 2, ...)
 }
@@ -142,6 +144,9 @@
 x1 <- permatswap(m, "swap", burnin = 1000, thin = 100)
 summary(x1)
 plot(x1)
+## The lag plot is useful to diagnose independence
+## of successive simulations for sequential algorithms
+lag.plot.permat(x1)
 ## Unrestricted permutation retaining
 ## row/columns sums but not matrix fill:
 x2 <- permatfull(m)



More information about the Vegan-commits mailing list