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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 17 08:32:43 CEST 2011


Author: jarioksa
Date: 2011-08-17 08:32:43 +0200 (Wed, 17 Aug 2011)
New Revision: 1721

Modified:
   pkg/vegan/R/plot.isomap.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/isomap.Rd
Log:
plot text and points over the net so that they are visible

Modified: pkg/vegan/R/plot.isomap.R
===================================================================
--- pkg/vegan/R/plot.isomap.R	2011-08-15 11:35:03 UTC (rev 1720)
+++ pkg/vegan/R/plot.isomap.R	2011-08-17 06:32:43 UTC (rev 1721)
@@ -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: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-08-15 11:35:03 UTC (rev 1720)
+++ pkg/vegan/inst/ChangeLog	2011-08-17 06:32:43 UTC (rev 1721)
@@ -20,6 +20,9 @@
 	around the plotting locations to contain the arrow and centroid
 	labels.
 
+	* plot.isomap: will always plot points or text above net so that
+	they are visible. Gained argument 'type'.
+
 Version 1.90-2 (closed August 6, 2011)
 
 	* ordilabel: gained argument 'select'.

Modified: pkg/vegan/man/isomap.Rd
===================================================================
--- pkg/vegan/man/isomap.Rd	2011-08-15 11:35:03 UTC (rev 1720)
+++ pkg/vegan/man/isomap.Rd	2011-08-17 06:32:43 UTC (rev 1721)
@@ -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. }
 }
@@ -68,7 +75,7 @@
   \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
+  \code{\link{scores}} or \code{\link{ordirgl}} functions so that you
   can select axes, or define colours and sizes of points.
 }
 



More information about the Vegan-commits mailing list