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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 9 19:47:57 CET 2008


Author: psolymos
Date: 2008-12-09 19:47:57 +0100 (Tue, 09 Dec 2008)
New Revision: 630

Added:
   pkg/vegan/R/lines.permat.R
Modified:
   pkg/vegan/R/plot.permat.R
   pkg/vegan/man/permatfull.Rd
Log:
permat plots updated


Added: pkg/vegan/R/lines.permat.R
===================================================================
--- pkg/vegan/R/lines.permat.R	                        (rev 0)
+++ pkg/vegan/R/lines.permat.R	2008-12-09 18:47:57 UTC (rev 630)
@@ -0,0 +1,6 @@
+## S3 lines method for permat
+`lines.permat` <-
+function(x, ...)
+{
+    lines(summary(x)$bray, ...)
+}

Modified: pkg/vegan/R/plot.permat.R
===================================================================
--- pkg/vegan/R/plot.permat.R	2008-12-09 06:53:18 UTC (rev 629)
+++ pkg/vegan/R/plot.permat.R	2008-12-09 18:47:57 UTC (rev 630)
@@ -5,7 +5,8 @@
     n <- attr(x, "times")
     bray <- numeric(n)
 #    for (i in 1:n) bray[i] <- sum(abs(x$orig-x$perm[[i]]))/sum(x$orig+x$perm[[i]])
-    bray <- sapply(x$perm, function(z) sum(abs(x$orig - z)) / sum(x$orig + z))
+#    bray <- sapply(x$perm, function(z) sum(abs(x$orig - z)) / sum(x$orig + z))
+    bray <- summary(x)$bray
     if (plot) {
         plot(bray,type="n",ylab=ylab,xlab=xlab, ...)
         lines(bray,col=col[1], lty=lty[1])

Modified: pkg/vegan/man/permatfull.Rd
===================================================================
--- pkg/vegan/man/permatfull.Rd	2008-12-09 06:53:18 UTC (rev 629)
+++ pkg/vegan/man/permatfull.Rd	2008-12-09 18:47:57 UTC (rev 630)
@@ -4,6 +4,7 @@
 \alias{permatswap}
 \alias{permat.control}
 \alias{plot.permat}
+\alias{lines.permat}
 \alias{print.permat}
 \alias{summary.permat}
 \alias{print.summary.permat}
@@ -26,6 +27,7 @@
 burnin = 10000, thin = 1000)
 \method{plot}{permat}(x, ylab="Bray-Curtis dissimilarity", 
 xlab="Runs", col=c(2,4), lty=c(1,2), plot=TRUE, text=TRUE, ...)
+\method{lines}{permat}(x, ...)
 \method{summary}{permat}(object, ...)
 \method{print}{summary.permat}(x, digits = 2, ...)
 }
@@ -73,7 +75,8 @@
 strata can be checked by the \code{summary} method. \code{plot} method is for
 visually testing the randomness of the permuted matrices, especially for the
 sequential swap algorithms. If there are any tendency in the graph, higher \code{burnin} and 
-\code{thin} values can help.
+\code{thin} values can help for sequential methods.
+New lines can be added to existing plot with the \code{lines} method.
 
 Unrestricted and restricted permutations:
 if \code{strata} is \code{NULL}, functions perform



More information about the Vegan-commits mailing list