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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 15 19:20:36 CET 2013


Author: gsimpson
Date: 2013-01-15 19:20:36 +0100 (Tue, 15 Jan 2013)
New Revision: 2374

Modified:
   pkg/vegan/R/orditorp.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/orditorp.Rd
Log:
add select argument and document

Modified: pkg/vegan/R/orditorp.R
===================================================================
--- pkg/vegan/R/orditorp.R	2013-01-15 17:28:12 UTC (rev 2373)
+++ pkg/vegan/R/orditorp.R	2013-01-15 18:20:36 UTC (rev 2374)
@@ -1,5 +1,5 @@
 `orditorp` <-
-    function (x, display, labels, choices = c(1, 2), priority,
+    function (x, display, labels, choices = c(1, 2), priority, select,
               cex = 0.7, pcex, col = par("col"),
               pcol, pch = par("pch"), air = 1, ...)
 {
@@ -13,6 +13,11 @@
         labels <- rownames(x)
     if (missing(priority))
         priority <- rowSums((scale(x)^2))
+    if (!missing(select)) {
+        x <- .checkSelect(select, x)
+        labels <- .checkSelect(select, labels)
+        priority <- .checkSelect(select, priority)
+    }
     ## remove NA scores
     x <- x[kk,]
     priority <- priority[kk]

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-01-15 17:28:12 UTC (rev 2373)
+++ pkg/vegan/inst/ChangeLog	2013-01-15 18:20:36 UTC (rev 2374)
@@ -49,6 +49,10 @@
 
 	* ordilabel: was missing ordiArgAbsorber() on the plotting calls
 	to text() and polygon(). Thus lots of warnings were raised in use.
+
+	* orditorp: added argument select, to choose which of the rows of
+	scores are plotted, so matches with ordilabel() and
+	ordipointlabel().
 	
 Version 2.1-22 (closed January 8, 2013)
 

Modified: pkg/vegan/man/orditorp.Rd
===================================================================
--- pkg/vegan/man/orditorp.Rd	2013-01-15 17:28:12 UTC (rev 2373)
+++ pkg/vegan/man/orditorp.Rd	2013-01-15 18:20:36 UTC (rev 2374)
@@ -11,7 +11,7 @@
 }
 \usage{
 orditorp(x, display, labels, choices = c(1, 2), priority,
-    cex = 0.7, pcex, col = par("col"), pcol,
+    select, cex = 0.7, pcex, col = par("col"), pcol,
     pch = par("pch"), air = 1, ...)
 }
 
@@ -27,6 +27,10 @@
   \item{priority}{ Text will be used for items with higher priority
     if labels overlap.  This should be vector of the same
     length as the number of items plotted.}
+  \item{select}{Items to be displayed.  This can either be a logical
+    vector which is \code{TRUE} for displayed items or a vector of indices
+    of displayed items. If a logical vector is used, it must have the
+    same length as the scores plotted.}
   \item{cex, pcex}{Text and point sizes, see \code{\link{plot.default}}..}
   \item{col, pcol}{Text and point colours, see \code{\link{plot.default}}.}
   \item{pch}{Plotting character, see \code{\link{points}}.}
@@ -72,6 +76,13 @@
 plot(mod, dis="sp", type="n")
 stems <- colSums(BCI)
 orditorp(mod, "sp", label = cnam, priority=stems, pch="+", pcol="grey")
+
+## show select in action
+take <- sample(nrow(BCI), 50)
+plot(mod, dis="sp", type="n")
+stems <- colSums(BCI)
+orditorp(mod, "sp", label = cnam, priority=stems, select = take,
+         pch="+", pcol="grey")
 }
 \keyword{ aplot }
 \keyword{ hplot }



More information about the Vegan-commits mailing list