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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 3 19:13:21 CET 2010


Author: gsimpson
Date: 2010-12-03 19:13:21 +0100 (Fri, 03 Dec 2010)
New Revision: 1392

Modified:
   branches/1.17/R/plot.betadisper.R
   branches/1.17/inst/ChangeLog
   branches/1.17/man/betadisper.Rd
Log:
merge r1390 to 1.17 branch and document change in ChangeLog

Modified: branches/1.17/R/plot.betadisper.R
===================================================================
--- branches/1.17/R/plot.betadisper.R	2010-12-03 18:09:47 UTC (rev 1391)
+++ branches/1.17/R/plot.betadisper.R	2010-12-03 18:13:21 UTC (rev 1392)
@@ -18,12 +18,11 @@
     if(is.matrix(g$centroids)) {
         for(i in levels(x$group)) {
             j <- which(levels(x$group) == i)
-            segments(g$centroids[j, axes[1]],
-                     g$centroids[j, axes[2]],
-                     g$sites[x$group == i, axes[1]],
-                     g$sites[x$group == i, axes[2]], col = "blue", ...)
+            segments(g$centroids[j, 1L], g$centroids[j, 2L],
+                     g$sites[x$group == i, 1L],
+                     g$sites[x$group == i, 2L], col = "blue", ...)
             if(hull) {
-                ch <- chull(g$sites[x$group == i, axes])
+                ch <- chull(g$sites[x$group == i, ])
                 ch <- c(ch, ch[1])
                 lines(x$vectors[x$group == i, axes][ch, ],
                       col = "black", lty = "dashed", ...)
@@ -32,21 +31,18 @@
         points(g$centroids, pch = 16, cex = 1, col = "red", ...)
     } else {
         ## single group
-        segments(g$centroids[axes[1]],
-                     g$centroids[axes[2]],
-                     g$sites[, axes[1]],
-                     g$sites[, axes[2]], col = "blue", ...)
-            if(hull) {
-                ch <- chull(g$sites[, axes])
-                ch <- c(ch, ch[1])
-                lines(x$vectors[, axes][ch, ],
-                      col = "black", lty = "dashed", ...)
-            }
-        points(g$centroids[axes[1]], g$centroids[axes[1]],
+        segments(g$centroids[1L], g$centroids[2L],
+                 g$sites[, 1L], g$sites[, 2L], col = "blue", ...)
+        if(hull) {
+            ch <- chull(g$sites)
+            ch <- c(ch, ch[1])
+            lines(x$vectors[, axes][ch, ],
+                  col = "black", lty = "dashed", ...)
+        }
+        points(g$centroids[1L], g$centroids[1L],
                pch = 16, cex = 1, col = "red", ...)
     }
-    points(g$sites, pch = as.numeric(x$group),
-           cex = cex, ...)
+    points(g$sites, pch = as.numeric(x$group), cex = cex, ...)
     localTitle(main = main, xlab = xlab, ylab = ylab, sub = sub, ...)
     localAxis(1, ...)
     localAxis(2, ...)

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-12-03 18:09:47 UTC (rev 1391)
+++ branches/1.17/inst/ChangeLog	2010-12-03 18:13:21 UTC (rev 1392)
@@ -62,6 +62,9 @@
 	inertia in print.cca, makes pcnm return its truncated distance
 	matrix. 
 
+	* merged r1390: fix to plot.betadisper when plotting any axes other
+	than 1 and 2.
+
 Version 1.17-4 (released August 20, 2010)
 
 	* merged r1263: mrpp.Rd polish.

Modified: branches/1.17/man/betadisper.Rd
===================================================================
--- branches/1.17/man/betadisper.Rd	2010-12-03 18:09:47 UTC (rev 1391)
+++ branches/1.17/man/betadisper.Rd	2010-12-03 18:13:21 UTC (rev 1392)
@@ -224,6 +224,9 @@
 ## first two PCoA axes
 plot(mod)
 
+## can also specify which axes to plot, ordering respected
+plot(mod, axes = c(3,1))
+
 ## Draw a boxplot of the distances to centroid for each group
 boxplot(mod)
 



More information about the Vegan-commits mailing list