[Vegan-commits] r2339 - in branches/2.0: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 14 11:10:18 CET 2012


Author: jarioksa
Date: 2012-12-14 11:10:18 +0100 (Fri, 14 Dec 2012)
New Revision: 2339

Modified:
   branches/2.0/NAMESPACE
   branches/2.0/R/monoMDS.R
   branches/2.0/R/plot.nestedtemp.R
   branches/2.0/R/print.monoMDS.R
   branches/2.0/R/scores.metaMDS.R
   branches/2.0/inst/ChangeLog
   branches/2.0/man/monoMDS.Rd
   branches/2.0/man/nestedtemp.Rd
Log:
merge revs 2332 (plot nestednodf), 2334-6 (monoMDS updates)

Modified: branches/2.0/NAMESPACE
===================================================================
--- branches/2.0/NAMESPACE	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/NAMESPACE	2012-12-14 10:10:18 UTC (rev 2339)
@@ -251,6 +251,7 @@
 S3method(plot, meandist)
 S3method(plot, metaMDS)
 S3method(plot, monoMDS)
+S3method(plot, nestednodf)
 S3method(plot, nestedtemp)
 S3method(plot, ordisurf)
 S3method(plot, orditkplot)

Modified: branches/2.0/R/monoMDS.R
===================================================================
--- branches/2.0/R/monoMDS.R	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/R/monoMDS.R	2012-12-14 10:10:18 UTC (rev 2339)
@@ -2,7 +2,7 @@
     function(dist, y, k = 2,
              model = c("global", "local", "linear", "hybrid"),
              threshold = 0.8, maxit = 200, weakties = TRUE, stress = 1,
-             scaling = TRUE, pc = TRUE, smin = 0.00001, sfgrmin = 0.00001,
+             scaling = TRUE, pc = TRUE, smin = 1e-4, sfgrmin = 1e-7,
              sratmax=0.99999, ...) 
 {
     ## Check that 'dist' are distances or a symmetric square matrix

Modified: branches/2.0/R/plot.nestedtemp.R
===================================================================
--- branches/2.0/R/plot.nestedtemp.R	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/R/plot.nestedtemp.R	2012-12-14 10:10:18 UTC (rev 2339)
@@ -1,3 +1,8 @@
+### plot() methods for those nested* functions that return sufficient
+### data to draw a plot. We display a plot using image() with coloured
+### rectangles for occurrences or colours dependent on the
+### contribution to the nestedness when appropriate.
+
 `plot.nestedtemp` <-
     function (x, kind = c("temperature", "incidence"),
               col = rev(heat.colors(100)), names = FALSE,  
@@ -22,3 +27,24 @@
             las = 2, ...)
     }
 }
+
+`plot.nestednodf` <-
+    function(x, col = "red", names = FALSE, ...)
+{
+    z <- x$comm
+    z <- t(z[nrow(z):1,])
+    if (length(col) == 1)
+        col <- c(NA, col)
+    image(z, axes = FALSE, col = col, ...)
+    box()
+    if (length(names) == 1)
+        names <- rep(names, 2)
+    if (names[1]) {
+        axis(2, at = seq(1, 0, len = ncol(z)), labels = rev(colnames(z)),
+            las = 2, ...)
+    }
+    if (names[2]) {
+        axis(3, at = seq(0, 1, len = nrow(z)), labels = rownames(z),
+            las = 2, ...)
+    }
+}

Modified: branches/2.0/R/print.monoMDS.R
===================================================================
--- branches/2.0/R/print.monoMDS.R	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/R/print.monoMDS.R	2012-12-14 10:10:18 UTC (rev 2339)
@@ -44,8 +44,10 @@
 {
     if (any(is.na(choices)))
         x$points
-    else
+    else {
+        choices <- choices[choices <= x$ndim]
         x$points[, choices, drop = FALSE]
+    }
 }
 
 `plot.monoMDS` <-

Modified: branches/2.0/R/scores.metaMDS.R
===================================================================
--- branches/2.0/R/scores.metaMDS.R	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/R/scores.metaMDS.R	2012-12-14 10:10:18 UTC (rev 2339)
@@ -1,9 +1,11 @@
-"scores.metaMDS" <-
+`scores.metaMDS` <-
     function(x, display = c("sites", "species"), shrink = FALSE, choices, ...)
 {
     display <- match.arg(display)
     if (missing(choices))
         choices <- 1:x$ndim
+    else
+        choices <- choices[choices <= x$ndim]
     if (display == "sites")
         X <- x$points
     else if (display == "species") {
@@ -21,6 +23,6 @@
         }
     }
     colnames(X) <- paste("NMDS", 1:ncol(X), sep="")
-    X[, choices]
+    X[, choices, drop = FALSE]
 }
 

Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/inst/ChangeLog	2012-12-14 10:10:18 UTC (rev 2339)
@@ -4,6 +4,9 @@
 
 Version 2.0-6 (opened October 8, 2012)
 
+	* merge 2336: stricter monoMDS convergence criteria.
+	* merge 2334,5: scores.monoMDS,metaMDS updates.
+	* merge 2332: add plot.nestednodf().
 	* merge 2330,1: ordiR2step() gained arg 'R2scope' and handles
 	partial RDA.
 	* merge 2328,9: add 'legend' arg to msoplot().

Modified: branches/2.0/man/monoMDS.Rd
===================================================================
--- branches/2.0/man/monoMDS.Rd	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/man/monoMDS.Rd	2012-12-14 10:10:18 UTC (rev 2339)
@@ -16,7 +16,7 @@
 \usage{
 monoMDS(dist, y, k = 2, model = c("global", "local", "linear", "hybrid"), 
     threshold = 0.8, maxit = 200, weakties = TRUE, stress = 1,
-    scaling = TRUE, pc = TRUE, smin = 0.00001, sfgrmin = 0.00001, 
+    scaling = TRUE, pc = TRUE, smin = 1e-4, sfgrmin = 1e-7, 
     sratmax=0.99999, ...) 
 \method{scores}{monoMDS}(x, choices = NA, ...)
 \method{plot}{monoMDS}(x, choices = c(1,2), type = "t", ...)

Modified: branches/2.0/man/nestedtemp.Rd
===================================================================
--- branches/2.0/man/nestedtemp.Rd	2012-12-13 15:14:52 UTC (rev 2338)
+++ branches/2.0/man/nestedtemp.Rd	2012-12-14 10:10:18 UTC (rev 2339)
@@ -8,6 +8,7 @@
 \alias{nestedbetasor}
 \alias{nestedbetajac}
 \alias{plot.nestedtemp}
+\alias{plot.nestednodf}
 
 \title{ Nestedness Indices for Communities of Islands or Patches }
 
@@ -28,6 +29,7 @@
 nestedbetajac(comm)
 \method{plot}{nestedtemp}(x, kind = c("temperature", "incidence"),
     col=rev(heat.colors(100)),  names = FALSE, ...)
+\method{plot}{nestednodf}(x, col = "red", names = FALSE, ...)
 }
 
 \arguments{



More information about the Vegan-commits mailing list