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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 29 11:24:52 CEST 2010


Author: jarioksa
Date: 2010-05-29 11:24:52 +0200 (Sat, 29 May 2010)
New Revision: 1202

Modified:
   pkg/vegan/R/ordiarrows.R
   pkg/vegan/R/ordisegments.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/ordihull.Rd
Log:
ordisegments gained 'label'

Modified: pkg/vegan/R/ordiarrows.R
===================================================================
--- pkg/vegan/R/ordiarrows.R	2010-05-29 06:09:34 UTC (rev 1201)
+++ pkg/vegan/R/ordiarrows.R	2010-05-29 09:24:52 UTC (rev 1202)
@@ -35,6 +35,6 @@
         }
     }
     if (label)
-        ordiArgAbsorber(starts, label = names, FUN = ordilabel, ...)
+        ordiArgAbsorber(starts, labels = names, FUN = ordilabel, ...)
     invisible()
 }

Modified: pkg/vegan/R/ordisegments.R
===================================================================
--- pkg/vegan/R/ordisegments.R	2010-05-29 06:09:34 UTC (rev 1201)
+++ pkg/vegan/R/ordisegments.R	2010-05-29 09:24:52 UTC (rev 1202)
@@ -1,6 +1,6 @@
 "ordisegments" <-
     function (ord, groups, levels, replicates, display = "sites",
-              show.groups, ...)
+              show.groups, label = FALSE, ...)
 {
     pts <- scores(ord, display = display, ...)
     npoints <- nrow(pts)
@@ -13,6 +13,7 @@
     }
     out <- seq(along = groups)
     inds <- names(table(groups))
+    ends <- names <- NULL
     for (is in inds) {
         gr <- out[groups == is]
         if (length(gr) > 1) {
@@ -21,7 +22,13 @@
             X1 <- X[-1, , drop = FALSE]
             ordiArgAbsorber(X0[, 1], X0[, 2], X1[, 1], X1[, 2],
                             FUN = segments, ...)
+            if (label) {
+                ends <- rbind(ends, X[c(1, nrow(X)), ])
+                names <- c(names, is, is)
+            }
         }
     }
+    if (label)
+        ordiArgAbsorber(ends, labels = names, FUN = ordilabel, ...)
     invisible()
 }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-05-29 06:09:34 UTC (rev 1201)
+++ pkg/vegan/inst/ChangeLog	2010-05-29 09:24:52 UTC (rev 1202)
@@ -13,6 +13,9 @@
 	* ordiarrows: gained 'label' argument which uses ordilabel() on
 	arrow starts.
 
+	* ordisegments: gained 'label' argument which uses ordilabel() on
+	both ends of the segment.
+
 	* ordispider: gained 'label' argument (uses ordilabel()). Can now
 	handle ordihull() result objects: connects points in the line to
 	the hull centroid. Extended examples.

Modified: pkg/vegan/man/ordihull.Rd
===================================================================
--- pkg/vegan/man/ordihull.Rd	2010-05-29 06:09:34 UTC (rev 1201)
+++ pkg/vegan/man/ordihull.Rd	2010-05-29 09:24:52 UTC (rev 1202)
@@ -33,7 +33,7 @@
 ordiarrows(ord, groups, levels, replicates, display = "sites",
          show.groups, startmark, label = FALSE, ...)
 ordisegments(ord, groups, levels, replicates, display = "sites",
-         show.groups, ...)
+         show.groups, label = FALSE, ...)
 ordigrid(ord, levels, replicates, display = "sites",  ...)
 ordicluster(ord, cluster, prune = 0, display = "sites",
          w = weights(ord, display), ...)



More information about the Vegan-commits mailing list