[Vegan-commits] r255 - in pkg: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 7 11:46:34 CET 2008


Author: jarioksa
Date: 2008-03-07 11:46:33 +0100 (Fri, 07 Mar 2008)
New Revision: 255

Added:
   pkg/R/rgl.isomap.R
Modified:
   pkg/DESCRIPTION
   pkg/inst/ChangeLog
   pkg/man/isomap.Rd
Log:
Dynamic 3D rgl graphics for isomap

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-03-06 20:32:48 UTC (rev 254)
+++ pkg/DESCRIPTION	2008-03-07 10:46:33 UTC (rev 255)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.12-2
-Date: Mar 2, 2008
+Version: 1.12-3
+Date: Mar 7, 2008
 Author: Jari Oksanen, Roeland Kindt, Pierre Legendre, Bob O'Hara, Gavin L. Simpson, 
   M. Henry H. Stevens  
 Maintainer: Jari Oksanen <jari.oksanen at oulu.fi>

Added: pkg/R/rgl.isomap.R
===================================================================
--- pkg/R/rgl.isomap.R	                        (rev 0)
+++ pkg/R/rgl.isomap.R	2008-03-07 10:46:33 UTC (rev 255)
@@ -0,0 +1,10 @@
+`rgl.isomap` <-
+    function(x, web = "white", ...)
+{
+    require(rgl) || stop("requires package 'rgl'")
+    ordirgl(x, ...)
+    z <- scores(x, ...)
+    net <- x$net
+    for (i in 1:nrow(net))
+        rgl.lines(z[net[i,],1], z[net[i,],2], z[net[i,],3], color=web)
+}

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-03-06 20:32:48 UTC (rev 254)
+++ pkg/inst/ChangeLog	2008-03-07 10:46:33 UTC (rev 255)
@@ -2,8 +2,13 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
-Version 1.12-2 (Mar 2, 2008, working...)
+Version 1.2-3 (Mar 7, 2008)
 
+	* isomap: added dynamic, spinnable 3D graphics using rgl
+	(rgl.isomap). 
+	
+Version 1.12-2 (closed Mar 7, 2008)
+
 	* nestedtemp: Rodriguez-Girones & Santamaria (J. Biogeogr. 33,
 	924-935; 2006) have had a look inside the original temperature
 	calculator code and give a more explicit description of the

Modified: pkg/man/isomap.Rd
===================================================================
--- pkg/man/isomap.Rd	2008-03-06 20:32:48 UTC (rev 254)
+++ pkg/man/isomap.Rd	2008-03-07 10:46:33 UTC (rev 255)
@@ -5,6 +5,7 @@
 \alias{summary.isomap}
 \alias{print.summary.isomap}
 \alias{print.isomap}
+\alias{rgl.isomap}
 
 \title{ Isometric Feature Mapping Ordination }
 \description{
@@ -19,6 +20,7 @@
 isomapdist(dist, epsilon, k, path = "shortest", fragmentedOK =FALSE, ...)
 \method{summary}{isomap}(object, axes = 4, ...)
 \method{plot}{isomap}(x, net = TRUE, n.col = "gray", ...)
+rgl.isomap(x, web = "white", ...)
 }
 
 \arguments{
@@ -37,6 +39,7 @@
   \item{axes}{Number of axes displayed.}
   \item{net}{Draw the net of retained dissimilarities.}
   \item{n.col}{Colour of drawn net segments.}
+  \item{web}{Colour of the web in \pkg{rgl} graphics.}
   \item{\dots}{Other parameters passed to functions. }
 }
 \details{
@@ -61,8 +64,14 @@
   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.
+}
 
-}
 \value{
   Function \code{isomapdist} returns a dissimilarity object similar to
   \code{dist}. Function \code{isomap} returns an object of class
@@ -115,6 +124,10 @@
 pl <- plot(isomap(dis, epsilon=0.45), main="isomap epsilon=0.45")
 lines(tr, pl, col="red")
 par(op)
+## The following command requires user interaction
+\dontrun{
+rgl.isomap(ord, size=4, color="hotpink")
 }
+}
 \keyword{ multivariate}
 



More information about the Vegan-commits mailing list