[Vegan-commits] r761 - in branches/1.15: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 26 10:53:00 CET 2009


Author: jarioksa
Date: 2009-03-26 10:52:59 +0100 (Thu, 26 Mar 2009)
New Revision: 761

Modified:
   branches/1.15/R/metaMDSdist.R
   branches/1.15/R/points.procrustes.R
   branches/1.15/inst/ChangeLog
   branches/1.15/man/procrustes.Rd
Log:
merged r689 (add text.procrustes) and r674 (metaMDSdist behavious when set noshare=0)

Modified: branches/1.15/R/metaMDSdist.R
===================================================================
--- branches/1.15/R/metaMDSdist.R	2009-03-26 08:55:54 UTC (rev 760)
+++ branches/1.15/R/metaMDSdist.R	2009-03-26 09:52:59 UTC (rev 761)
@@ -37,7 +37,7 @@
         }
     }
     maxdis <- max(dis)
-    if (sum(tmp <- no.shared(comm))/length(dis) > noshare && noshare > 0) {
+    if (noshare > 0 && sum(tmp <- no.shared(comm))/length(dis) > noshare) {
         if (trace) 
             cat("Using step-across dissimilarities:\n")
         rn <- range(dis[tmp])
@@ -46,9 +46,9 @@
                     "  stepacross may be meaningless: consider argument 'noshare=0'")
         is.na(dis) <- tmp
         dis <- stepacross(dis, trace = trace, toolong=0, ...)
+        if (length(unique(distconnected(tmp, trace = trace > 1))) > 1) 
+            warning("Data are disconnected, results may be meaningless")
     }
-    if (length(unique(distconnected(tmp, trace = trace > 1))) > 1) 
-        warning("Data are disconnected, results may be meaningless")
     attr(dis, "maxdis") <- maxdis
     attr(dis, "commname") <- commname
     attr(dis, "function") <- distname

Modified: branches/1.15/R/points.procrustes.R
===================================================================
--- branches/1.15/R/points.procrustes.R	2009-03-26 08:55:54 UTC (rev 760)
+++ branches/1.15/R/points.procrustes.R	2009-03-26 09:52:59 UTC (rev 761)
@@ -1,4 +1,4 @@
-"points.procrustes" <-
+`points.procrustes` <-
     function(x, display = c("target","rotated"), ...)
 {
     display <- match.arg(display)
@@ -6,3 +6,14 @@
     points(x, ...)
     invisible()
 }
+
+`text.procrustes` <-
+    function(x, display = c("target","rotated"), labels, ...)
+{
+    display <- match.arg(display)
+    x <- if (display == "target") x$X else x$Yrot
+    if (missing(labels))
+        labels <- rownames(x)
+    text(x, labels = labels, ...)
+    invisible()
+}

Modified: branches/1.15/inst/ChangeLog
===================================================================
--- branches/1.15/inst/ChangeLog	2009-03-26 08:55:54 UTC (rev 760)
+++ branches/1.15/inst/ChangeLog	2009-03-26 09:52:59 UTC (rev 761)
@@ -11,6 +11,8 @@
 	open-ended dissimilarities (Euclidean, Manhattan etc.).
 
 	* merged r728: oecosimu.Rd example knows "statistic" argument.
+
+	* merged r689: added text.procrustes.
 	
 	* merged r683 & r690: anova.cca(..., by = "margin") gained
 	argument "cutoff = 1", and doc expanded.
@@ -19,6 +21,9 @@
 
 	* merged r678: anovacca.bymargin was not setting RNG properly for
 	the second term.
+
+	* merged r674: metaMDSdist does not evaluate no.shared if set
+	noshared=0. 
 	
 	* merged r673: vegdist doc fixes for Horn-Morisita equation.
 	

Modified: branches/1.15/man/procrustes.Rd
===================================================================
--- branches/1.15/man/procrustes.Rd	2009-03-26 08:55:54 UTC (rev 760)
+++ branches/1.15/man/procrustes.Rd	2009-03-26 09:52:59 UTC (rev 761)
@@ -5,6 +5,7 @@
 \alias{print.summary.procrustes}
 \alias{plot.procrustes}
 \alias{points.procrustes}
+\alias{text.procrustes}
 \alias{lines.procrustes}
 \alias{residuals.procrustes}
 \alias{fitted.procrustes}
@@ -23,6 +24,7 @@
 \method{plot}{procrustes}(x, kind=1, choices=c(1,2), xlab, ylab, main,
      ar.col = "blue", len=0.05, ...)
 \method{points}{procrustes}(x, display = c("target", "rotated"), ...)
+\method{text}{procrustes}(x, display = c("target", "rotated"), labels, ...)
 \method{lines}{procrustes}(x, type = c("segments", "arrows"), choices = c(1, 2), ...)  
 \method{residuals}{procrustes}(object, ...)
 \method{fitted}{procrustes}(object, truemean = TRUE, ...)
@@ -61,6 +63,8 @@
     specified strata.}
   \item{ar.col}{Arrow colour.}
   \item{len}{Width of the arrow head.}
+  \item{labels}{Character vector of text labels. Rownames of the result 
+    object are used as default.}
   \item{...}{Other parameters passed to functions. In \code{procrustes}
     and \code{protest} parameters are passed to \code{\link{scores}}, in
     graphical functions to underlying graphical functions.}



More information about the Vegan-commits mailing list