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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 26 17:34:44 CEST 2009


Author: jarioksa
Date: 2009-08-26 17:34:44 +0200 (Wed, 26 Aug 2009)
New Revision: 956

Modified:
   pkg/vegan/R/ordiellipse.R
   pkg/vegan/R/ordihull.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/ordihull.Rd
Log:
ordiellipse & ordihull arg 'draw' got new alternative 'none'

Modified: pkg/vegan/R/ordiellipse.R
===================================================================
--- pkg/vegan/R/ordiellipse.R	2009-08-26 15:23:43 UTC (rev 955)
+++ pkg/vegan/R/ordiellipse.R	2009-08-26 15:34:44 UTC (rev 956)
@@ -1,6 +1,7 @@
 "ordiellipse" <-
     function (ord, groups, display = "sites", kind = c("sd", "se"),
-              conf, draw = c("lines", "polygon"), w = weights(ord, display),
+              conf, draw = c("lines", "polygon", "none"),
+              w = weights(ord, display),
               show.groups, label = FALSE,  ...)
 {
     ## Define Circle for an ellipse: taken from the 'car' package
@@ -38,9 +39,9 @@
             xy <- t(mat$center + t * t(Circle %*% chol(mat$cov)))
             if (draw == "lines")
                 ordiArgAbsorber(xy, FUN = lines, ...)
-            else 
+            else if (draw == "polygon") 
                 ordiArgAbsorber(xy[, 1], xy[, 2], FUN = polygon, ...)
-            if (label)
+            if (label && draw != "none")
                 ordiArgAbsorber(mat$center[1], mat$center[2], labels=is,
                                FUN = text, ...)
             mat$scale <- t

Modified: pkg/vegan/R/ordihull.R
===================================================================
--- pkg/vegan/R/ordihull.R	2009-08-26 15:23:43 UTC (rev 955)
+++ pkg/vegan/R/ordihull.R	2009-08-26 15:34:44 UTC (rev 956)
@@ -1,5 +1,6 @@
 "ordihull" <-
-    function (ord, groups, display = "sites", draw = c("lines", "polygon"),
+    function (ord, groups, display = "sites",
+              draw = c("lines", "polygon", "none"),
               show.groups, label = FALSE, ...)
 {
     draw <- match.arg(draw)
@@ -20,8 +21,9 @@
             hpts <- c(hpts, hpts[1])
             if (draw == "lines")
                 ordiArgAbsorber(X[hpts, ], FUN = lines, ...)
-            else ordiArgAbsorber(X[hpts,], FUN = polygon, ...)
-            if (label) {
+            else if (draw == "polygon")
+                ordiArgAbsorber(X[hpts,], FUN = polygon, ...)
+            if (label && draw != "none") {
                 cntr <- colMeans(X)
                 ordiArgAbsorber(cntr[1], cntr[2], labels = is,
                                 FUN = text, ...)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-08-26 15:23:43 UTC (rev 955)
+++ pkg/vegan/inst/ChangeLog	2009-08-26 15:34:44 UTC (rev 956)
@@ -7,8 +7,13 @@
 	* mantel.correlog: updated to the version 1.4 of Pierre Legendre's
 	package. 
 
-	*  RsquareAdj documented.
+	*  RsquareAdj: documented.
 
+	* ordiellipse & ordihull: argument 'draw' got a new alternative
+	"none". With this, nothing is drawn but the invisible plotting
+	structure is returned. This was added so that it is easier to
+	develop permutation tests for hulls and ellipses.
+
 Version 1.16-24 (opened August 17, 2009)
 
 	* ordiellipse & ordihull: gained new argument 'label' to put the

Modified: pkg/vegan/man/ordihull.Rd
===================================================================
--- pkg/vegan/man/ordihull.Rd	2009-08-26 15:23:43 UTC (rev 955)
+++ pkg/vegan/man/ordihull.Rd	2009-08-26 15:34:44 UTC (rev 956)
@@ -22,10 +22,10 @@
   \code{\link{ordiplot}}.
 }
 \usage{
-ordihull(ord, groups, display = "sites", draw = c("lines","polygon"),
+ordihull(ord, groups, display = "sites", draw = c("lines","polygon", "none"),
          show.groups, label = FALSE,  ...)
 ordiellipse(ord, groups, display="sites", kind = c("sd","se"), conf,
-         draw = c("lines","polygon"), w = weights(ord, display),
+         draw = c("lines","polygon", "none"), w = weights(ord, display),
          show.groups, label = FALSE, ...)
 ordispider(ord, groups, display="sites", w = weights(ord, display),
          show.groups, ...)
@@ -51,7 +51,9 @@
   \item{draw}{Use either \code{\link{lines}} or \code{\link{polygon}} to
     draw the
     line. Graphical parameters are passed to both. The main difference
-    is that \code{polygon}s may be filled and non-transparent.}
+    is that \code{polygon}s may be filled and non-transparent. With \code{none}
+    nothing is drawn, but the function returns the \code{\link{invisible}}
+    plotting data.}
   \item{show.groups}{Show only given groups. This can be a vector, or
     \code{TRUE} if you want to show items for which condition is
     \code{TRUE}. This argument makes it possible to use different
@@ -107,7 +109,8 @@
   the coordinates of the centres of the ellipses or hulls and their
   surface areas in user units. The centres of the hulls may differ
   from the location of the \code{label} which is the centre of the
-  points instead of the centre of the polygon.
+  points instead of the centre of the polygon. With \code{draw = "none"}
+  only the result object is returned and nothing is drawn.
 
   Function \code{ordiarrows} draws
   \code{\link{arrows}} and \code{ordisegments} draws line



More information about the Vegan-commits mailing list