[Vegan-commits] r2537 - in pkg/vegan: . inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 27 00:58:58 CEST 2013


Author: gsimpson
Date: 2013-06-27 00:58:58 +0200 (Thu, 27 Jun 2013)
New Revision: 2537

Modified:
   pkg/vegan/NAMESPACE
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/ordipointlabel.Rd
Log:
add plot method for ordipointlabel that doesn't fiddle with par()

Modified: pkg/vegan/NAMESPACE
===================================================================
--- pkg/vegan/NAMESPACE	2013-06-26 06:57:12 UTC (rev 2536)
+++ pkg/vegan/NAMESPACE	2013-06-26 22:58:58 UTC (rev 2537)
@@ -258,6 +258,7 @@
 S3method(plot, nestednodf)
 S3method(plot, nestedtemp)
 S3method(plot, ordisurf)
+S3method(plot, ordipointlabel)
 S3method(plot, orditkplot)
 S3method(plot, permat)
 S3method(plot, poolaccum)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-06-26 06:57:12 UTC (rev 2536)
+++ pkg/vegan/inst/ChangeLog	2013-06-26 22:58:58 UTC (rev 2537)
@@ -27,7 +27,7 @@
 	coordinates of text box at the point of the arrow so that the
 	arrow point just touches the text.  This should improve
 	positioning of the arrow labels and avoid writing labels over the
-	arrows. 
+	arrows.
 
 	* plot.envfit, plot.cca, text.cca: use ordiArrowTextXY() for arrow
 	labels instead of expanding arrow heads by 10%.
@@ -39,6 +39,11 @@
 	were poorly estimated. This became evident with new positioning of
 	arrow text based on string dimensions.
 
+        * plot.ordipointlabel: gains a plot method that is very similar to
+        `plot.orditkplot()` but which does not mess with graphical
+        parameters. This allows it to fit more naturally into a standard
+        R workflow (it plays nicely with `layout()` for example.
+
 Version 2.1-30 (opened May 5, 2013)
 
 	* bioenv: can now use Mahalanobis, Manhattan and Gower distances

Modified: pkg/vegan/man/ordipointlabel.Rd
===================================================================
--- pkg/vegan/man/ordipointlabel.Rd	2013-06-26 06:57:12 UTC (rev 2536)
+++ pkg/vegan/man/ordipointlabel.Rd	2013-06-26 22:58:58 UTC (rev 2537)
@@ -1,5 +1,6 @@
 \name{ordipointlabel}
 \alias{ordipointlabel}
+\alias{plot.ordipointlabel}
 
 \title{ Ordination Plots with Points and Optimized Locations for Text }
 \description{
@@ -13,10 +14,14 @@
 ordipointlabel(x, display = c("sites", "species"), choices = c(1, 2),
    col = c(1, 2),  pch = c("o", "+"), font = c(1, 1), 
    cex = c(0.8, 0.8), add = FALSE, select, ...)
+
+\method{plot}{ordipointlabel}(x, ...)
 }
 
 \arguments{
-  \item{x}{A result object from ordination. }
+  \item{x}{For \code{ordipointlabel()} a result object from an
+    ordination function. For \code{plot.ordipointlabel} an object
+    resulting from a call to \code{ordipointlabel()}.}
   \item{display}{Scores displayed in the plot. }
   \item{choices}{Axes shown. }
   \item{col, pch, font, cex}{Colours, point types, font style and
@@ -56,9 +61,14 @@
   label. In addition, it returns the result of \code{\link{optim}} as
   an attribute \code{"optim"}. The unit of overlap is the area
   of character \code{"m"}, and with variable \code{cex} it is the
-  smallest alternative. The result object inherits from
-  \code{\link{orditkplot}} result, and can be replotted with its
-  \code{plot} command. It may be possible to further edit the result
+  smallest alternative.
+
+  There is a \code{plot} method based on \code{orditkplot} but which
+  does not alter nor reset the graphical parameters via \code{par}.
+  
+  The result object from \code{ordipointlabel} inherits from
+  \code{\link{orditkplot}}, and can also be replotted with its
+  \code{plot} method. It may be possible to further edit the result
   object with \code{\link{orditkplot}}, but for good results it is
   necessary that the points span the whole horizontal axis without empty
   margins. 
@@ -74,7 +84,7 @@
 \examples{
 data(dune)
 ord <- cca(dune)
-ordipointlabel(ord)
+plt <- ordipointlabel(ord)
 
 ## set scaling - should be no warnings!
 ordipointlabel(ord, scaling = 1)
@@ -83,6 +93,9 @@
 plot(ord, scaling = 3, type = "n")
 ordipointlabel(ord, display = "species", scaling = 3, add = TRUE)
 ordipointlabel(ord, display = "sites", scaling = 3, add = TRUE)
+
+## redraw plot without rerunning SANN optimisation
+plot(plt)
 }
 \keyword{ hplot }
 \keyword{ aplot }



More information about the Vegan-commits mailing list