[Vegan-commits] r1724 - in branches/1.17: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 17 10:27:16 CEST 2011


Author: jarioksa
Date: 2011-08-17 10:27:16 +0200 (Wed, 17 Aug 2011)
New Revision: 1724

Modified:
   branches/1.17/R/ordiplot.R
   branches/1.17/R/plot.isomap.R
   branches/1.17/inst/ChangeLog
   branches/1.17/inst/NEWS
   branches/1.17/man/isomap.Rd
   branches/1.17/man/ordiplot.Rd
Log:
merge 1721 thru 1723: plot.isomap & ordiplot upgrade

Modified: branches/1.17/R/ordiplot.R
===================================================================
--- branches/1.17/R/ordiplot.R	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/R/ordiplot.R	2011-08-17 08:27:16 UTC (rev 1724)
@@ -1,6 +1,6 @@
 `ordiplot` <-
     function (ord, choices = c(1, 2), type = "points", display, xlim,
-              ylim, ...)
+              ylim, cex = 0.7, ...)
 {
     ## local functions to absorb non-par arguments of plot.default
     localPoints <- function(..., log, frame.plot, panel.first,
@@ -58,15 +58,15 @@
              ...)
         if (type == "points") {
             if (!is.null(X))
-                localPoints(X, pch = 1, col = 1, cex = 0.7, ...)
+                localPoints(X, pch = 1, col = 1, cex = cex, ...)
             if (!is.null(Y))
-                localPoints(Y, pch = "+", col = "red", cex = 0.7, ...)
+                localPoints(Y, pch = "+", col = "red", cex = cex, ...)
         }
         if (type == "text") {
             if (!is.null(X))
-                localText(X, labels = rownames(X), col = 1, cex = 0.7, ...)
+                localText(X, labels = rownames(X), col = 1, cex = cex, ...)
             if (!is.null(Y))
-                localText(Y, labels = rownames(Y), col = "red", cex = 0.7, ...)
+                localText(Y, labels = rownames(Y), col = "red", cex = cex, ...)
         }
         out <- list(sites = X, species = Y)
     }

Modified: branches/1.17/R/plot.isomap.R
===================================================================
--- branches/1.17/R/plot.isomap.R	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/R/plot.isomap.R	2011-08-17 08:27:16 UTC (rev 1724)
@@ -1,12 +1,19 @@
 `plot.isomap` <-
-function (x, net=TRUE, n.col = "gray", ...) 
+    function (x, net = TRUE, n.col = "gray", type = "points", ...) 
 {
-	pl <- ordiplot(x, display="sites", ...)
-	if (net) {
-		z <- scores(pl, "sites")
-		k <- x$net
-		segments(z[k[,1],1], z[k[,1],2], z[k[,2],1], z[k[,2],2], col=n.col)
-	}
-	invisible(pl)
+    type <- match.arg(type, c("points", "text", "none"))
+    if (!net) {
+        pl <- ordiplot(x, display="sites", type = type, ...)
+    } else {
+        pl <- ordiplot(x, display = "sites", type = "none", ...)
+        z <- scores(pl, "sites")
+        k <- x$net
+        segments(z[k[,1],1], z[k[,1],2], z[k[,2],1], z[k[,2],2], col=n.col)
+        if (type == "points")
+            points(pl, "sites", ...)
+        else if (type == "text")
+            ordilabel(pl, ...)
+    }
+    invisible(pl)
 }
 

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/inst/ChangeLog	2011-08-17 08:27:16 UTC (rev 1724)
@@ -9,6 +9,8 @@
 	monoMDS. Also adds the minimal NAMESPACE file of 1695 (without S3
 	method registration and later revs).
 	* tolerance (generic), tolerance.cca: copy from devel at 1558.
+	* merged 1722: ordiplot gains 'cex'.
+	* merged 1721, 1723: plot.isomap upgrade.
 	* merged 1704, 1713: better axis limits in plot.envfit to allow
 	space for vector and centroid labels.
 	* partially merged 1700: model.{frame,matrix}.cca scoping,

Modified: branches/1.17/inst/NEWS
===================================================================
--- branches/1.17/inst/NEWS	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/inst/NEWS	2011-08-17 08:27:16 UTC (rev 1724)
@@ -12,7 +12,7 @@
       widths (a.k.a. tolerances) and sample heteregeneities from a
       cca() result.
 
-    - adonis: clearly faster.
+    - adonis: much faster.
 
     - betadiver: argument 'index' was renamed to 'method' so that the
       function can be used similarly as dist(), vegdist() and other
@@ -27,6 +27,9 @@
       screeplot.cca, calibrate.cca, deviance.cca/rda, ordiplot3d,
       ordiresids, ordirgl, ordixytplot.
 
+    - isomap: text or points are plotted more cleanly, and text uses
+      ordilabel(). 
+
     - make.cepnames: a bit more flexible and robust, with a new
       argument that allows selecting first and second name component
       instead of first and last.
@@ -38,7 +41,8 @@
 
     - ordilabel: gained argument 'select'. 
 
-    - ordiplot: better handling of graphical arguments.
+    - ordiplot: better handling of graphical arguments, arg 'cex' can
+      be set by the user.
 
     - swan: gained new argument 'maxit' that allows setting maximum
       number of iterations (defaults 'maxit = Inf' or the current

Modified: branches/1.17/man/isomap.Rd
===================================================================
--- branches/1.17/man/isomap.Rd	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/man/isomap.Rd	2011-08-17 08:27:16 UTC (rev 1724)
@@ -19,7 +19,7 @@
 isomap(dist, ndim=10, ...)
 isomapdist(dist, epsilon, k, path = "shortest", fragmentedOK =FALSE, ...)
 \method{summary}{isomap}(object, axes = 4, ...)
-\method{plot}{isomap}(x, net = TRUE, n.col = "gray", ...)
+\method{plot}{isomap}(x, net = TRUE, n.col = "gray", type = "points", ...)
 rgl.isomap(x, web = "white", ...)
 }
 
@@ -39,6 +39,13 @@
   \item{axes}{Number of axes displayed.}
   \item{net}{Draw the net of retained dissimilarities.}
   \item{n.col}{Colour of drawn net segments.}
+
+  \item{type}{Plot observations either as \code{"points"},
+    \code{"text"} or use \code{"none"} to plot no observations. The
+    \code{"text"} will use \code{\link{ordilabel}} if \code{net =
+    TRUE} and \code{\link{ordiplot}} if \code{net = FALSE}, and pass
+    extra arguments to these functions.}
+
   \item{web}{Colour of the web in \pkg{rgl} graphics.}
   \item{\dots}{Other parameters passed to functions. }
 }
@@ -64,13 +71,15 @@
   used \code{epsilon} criterion.  In practice, De'ath also retains
   higher proportion of dissimilarities than typical \code{isomap}.
 
-  In addition to the standard \code{plot} function, function
-  \code{rgl.isomap} can make dynamic 3D plots that can be rotated on the
-  screen. The functions is based on \code{\link{ordirgl}}, but it adds
-  the connecting lines. The function passes extra arguments to
-  \code{\link{scores}} and \code{\link{ordirgl}} functions so that you
-  can select axes, or define colours and sizes of points.
-}
+  The \code{plot} function uses internally \code{\link{ordiplot}},
+  except that it adds text over net using \code{\link{ordilabel}}. The
+  \code{plot} function passes extra arguments to these functions.  In
+  addition, function \code{rgl.isomap} can make dynamic 3D plots that
+  can be rotated on the screen. The functions is based on
+  \code{\link{ordirgl}}, but it adds the connecting lines. The function
+  passes extra arguments to \code{\link{scores}} or
+  \code{\link{ordirgl}} functions so that you can select axes, or define
+  colours and sizes of points.  }
 
 \value{
   Function \code{isomapdist} returns a dissimilarity object similar to

Modified: branches/1.17/man/ordiplot.Rd
===================================================================
--- branches/1.17/man/ordiplot.Rd	2011-08-17 08:21:51 UTC (rev 1723)
+++ branches/1.17/man/ordiplot.Rd	2011-08-17 08:27:16 UTC (rev 1724)
@@ -16,7 +16,8 @@
   \code{\link{plot.rad}} as well.
 }
 \usage{
-ordiplot(ord, choices = c(1, 2), type="points", display, xlim, ylim, ...)
+ordiplot(ord, choices = c(1, 2), type="points", display, xlim, ylim,
+     cex = 0.7, ...)
 \method{identify}{ordiplot}(x, what, labels,  ...)
 \method{points}{ordiplot}(x, what, select, ...)
 \method{text}{ordiplot}(x, what, labels, select, ...)
@@ -32,6 +33,7 @@
     \code{\link{rda}} and \code{\link{capscale}} it is the same as in
     \code{\link{plot.cca}}.  }
   \item{xlim, ylim}{the x and y limits (min,max) of the plot.}
+  \item{cex}{Character expansion factor for points and text.}
   \item{\dots}{Other graphical parameters. }
   \item{x}{A result object from \code{ordiplot}.}
   \item{what}{Items identified in the ordination plot. The types depend



More information about the Vegan-commits mailing list