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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 29 09:02:25 CEST 2009


Author: jarioksa
Date: 2009-03-29 09:02:24 +0200 (Sun, 29 Mar 2009)
New Revision: 764

Modified:
   branches/1.15/R/commsimulator.R
   branches/1.15/R/cophenetic.spantree.R
   branches/1.15/R/orditkplot.R
   branches/1.15/R/plot.rad.R
   branches/1.15/R/plot.spantree.R
   branches/1.15/R/spantree.R
   branches/1.15/inst/ChangeLog
   branches/1.15/man/decorana.Rd
   branches/1.15/man/decostand.Rd
   branches/1.15/man/metaMDS.Rd
   branches/1.15/man/radfit.Rd
   branches/1.15/man/spantree.Rd
   branches/1.15/man/specpool.Rd
Log:
merged some safe-looking changes to branches/1.15: r518, r538-540, r608, r676

Modified: branches/1.15/R/commsimulator.R
===================================================================
--- branches/1.15/R/commsimulator.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/commsimulator.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -94,6 +94,7 @@
                 out <- oldout
         }
     }
+    colnames(out) <- colnames(x)
+    rownames(out) <- rownames(x)
     out
 }
-

Modified: branches/1.15/R/cophenetic.spantree.R
===================================================================
--- branches/1.15/R/cophenetic.spantree.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/cophenetic.spantree.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -7,6 +7,6 @@
     ind <- t(ind[2:1,])
     mat[ind] <- x$dist
     d <- as.dist(mat)
+    attr(d, "Labels") <- x$labels
     stepacross(d, path = "extended", toolong=0, trace=FALSE)
 }
-

Modified: branches/1.15/R/orditkplot.R
===================================================================
--- branches/1.15/R/orditkplot.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/orditkplot.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -230,6 +230,7 @@
                     "png" = "{PNG File} {.png}",
                     "jpg" = "{JPEG File} {.jpg .jpeg}",
                     "bmp" = "{BMP File} {.bmp}",
+                    "tiff"= "{TIFF File} {.tif .tiff}",
                     "fig" = "{XFig File} {.fig}")
         falt <- rep(TRUE, length(ftypes))
         names(falt) <- names(ftypes)
@@ -237,6 +238,10 @@
             falt["png"] <- FALSE
         if (!capabilities("jpeg"))
             falt["jpg"] <- FALSE
+        ## Should work also in R < 2.8.0 with no capabilities("tiff")
+        if (!isTRUE(unname(capabilities("tiff"))))
+            falt["tiff"] <- FALSE
+        ## bmp lives only in Windows
         if (.Platform$OS.type != "windows")
             falt["bmp"] <- FALSE
         ftypes <- ftypes[falt]
@@ -248,6 +253,8 @@
         ftype <- ftype[length(ftype)]
         if (ftype == "jpeg")
             ftype <- "jpg"
+        if (ftype == "tif")
+            ftype <- "tiff"
         mess <- "is not a supported type: file not produced. Supported types are"
         if (!(ftype %in% names(ftypes))) {
             tkmessageBox(message=paste(sQuote(ftype), mess, paste(names(ftypes),
@@ -261,7 +268,8 @@
                pdf = pdf(file=fname, width=xy$dim[1], height=xy$dim[2]),
                png = png(file=fname, width=pixdim[1], height=pixdim[2]),
                jpg = jpeg(file=fname, width=pixdim[1], height=pixdim[2],
-               quality = 100), 
+               quality = 100),
+               tiff = tiff(file=fname, width=pixdim[1], height=pixdim[2]),
                bmp = bmp(file=fname, width=pixdim[1], height=pixdim[2]),
                fig = xfig(file=fname, width=xy$dim[1], height=xy$dim[2]))
         plot.orditkplot(xy)

Modified: branches/1.15/R/plot.rad.R
===================================================================
--- branches/1.15/R/plot.rad.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/plot.rad.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -1,8 +1,8 @@
 "plot.rad" <-
-    function(x, xlab="Rank", ylab="Abundance",  ...)
+    function(x, xlab="Rank", ylab="Abundance", log = "y", ...)
 {
     rnk <- seq(along=x)
-    plot(rnk, x, log="y", xlab=xlab, ylab=ylab, ...)
+    plot(rnk, x, log=log, xlab=xlab, ylab=ylab, ...)
     out <- list(species = cbind(rnk, x))
     class(out) <- "ordiplot"
     invisible(out)

Modified: branches/1.15/R/plot.spantree.R
===================================================================
--- branches/1.15/R/plot.spantree.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/plot.spantree.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -26,8 +26,8 @@
         points(ord, cex = cex, ...)
     else if (type == "t") {
         if (missing(labels)) 
-            labels <- rownames(ord)
-        text(ord, labels = labels, cex = cex, ...)
+            labels <- x$labels
+        ordilabel(ord, display = "sites", labels = labels, cex = cex, ...)
     }
     ord <- list(sites = ord)
     class(ord) <- "ordiplot"

Modified: branches/1.15/R/spantree.R
===================================================================
--- branches/1.15/R/spantree.R	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/R/spantree.R	2009-03-29 07:02:24 UTC (rev 764)
@@ -3,11 +3,12 @@
 {
     dis <- as.dist(dis)
     n <- attr(dis, "Size")
+    labels <- labels(dis)
     dis <- .C("primtree", dist = as.double(dis), toolong = as.double(toolong), 
               n = as.integer(n), val = double(n + 1),
               dad = integer(n + 1), NAOK = TRUE, PACKAGE = "vegan")
-    out <- list(kid = dis$dad[2:n] + 1, dist = dis$val[2:n])
+    out <- list(kid = dis$dad[2:n] + 1, dist = dis$val[2:n],
+                labels = labels)
     class(out) <- "spantree"
     out
 }
-

Modified: branches/1.15/inst/ChangeLog
===================================================================
--- branches/1.15/inst/ChangeLog	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/inst/ChangeLog	2009-03-29 07:02:24 UTC (rev 764)
@@ -5,6 +5,18 @@
 
 Version 1.15-2 (opened January 14, 2009)
 
+	* merged r608: plot.radfit gained argument log = "y".
+
+	* merged r538: orditkplot makes TIFF graphics.
+
+	* merged r539, 540: spantree retains names, and plot.spantree uses
+	ordilabel in plots.
+
+	* merged r676: commsimulator results retain names.
+	
+	* merged r518: doubled "the" in man pages of decorana, spantree,
+	decostand, specpool and metaMDS.
+	
 	* merged r750: better example in add1.cca.Rd.
 
 	* merged r735 & r736: stepacross fixes in metaMDSdist with

Modified: branches/1.15/man/decorana.Rd
===================================================================
--- branches/1.15/man/decorana.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/decorana.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -126,7 +126,7 @@
   eigenvalues. The proper eigenvalues are estimated after extraction of
   the axes and they are the ratio of biased weighted variances of site
   and species scores even in detrended and rescaled solutions. The
-  `decorana values' are provided only for the the compatibility with
+  `decorana values' are provided only for the compatibility with
   legacy software, and they should not be used.
 }
 \value{

Modified: branches/1.15/man/decostand.Rd
===================================================================
--- branches/1.15/man/decostand.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/decostand.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -44,7 +44,7 @@
     \item \code{chi.square}: divide by row sums and square root of
     column sums, and adjust for square root of matrix total
     (Legendre & Gallagher 2001). When used with the Euclidean
-    distance, the distances should be similar to the the
+    distance, the distances should be similar to the
     Chi-square distance used in correspondence analysis. However, the
     results from \code{\link{cmdscale}} would still differ, since
     CA is a weighted ordination method (default \code{MARGIN =

Modified: branches/1.15/man/metaMDS.Rd
===================================================================
--- branches/1.15/man/metaMDS.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/metaMDS.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -176,7 +176,7 @@
     based on closer dissimilarities where the relation between ordination
     distance and community dissimilarity is rather linear; the limit is
     controlled by parameter \code{threshold}.  If there are enough points
-    below this threshold (controlled by the the parameter
+    below this threshold (controlled by the parameter
     \code{nthreshold}), dissimilarities are regressed on distances.
     The intercept of this regression is taken as the replicate
     dissimilarity, and half-change is the distance where similarity

Modified: branches/1.15/man/radfit.Rd
===================================================================
--- branches/1.15/man/radfit.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/radfit.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -43,7 +43,7 @@
 \method{lines}{radline}(x, ...)
 \method{points}{radline}(x, ...)
 as.rad(x)
-\method{plot}{rad}(x, xlab = "Rank", ylab = "Abundance", ...)
+\method{plot}{rad}(x, xlab = "Rank", ylab = "Abundance", log = "y", ...)
 }
 
 \arguments{
@@ -68,6 +68,11 @@
   \item{type}{Type of the plot, \code{"b"} for plotting both observed points
     and fitted lines, \code{"p"} for only points, \code{"l"} for only
     fitted lines, and \code{"n"} for only setting the frame. }
+  \item{log}{Use logarithmic scale for given axis. The default
+    \code{log =" y"} gives the traditional plot in community ecology
+    where the pre-emption model is a straight line, and with
+    \code{log = "xy"} Zipf model is a straight line. With
+    \code{log = ""} both axes are in the original arithmetic scale.}
   \item{\dots}{Other parameters to functions. }
 }
 \details{
@@ -218,7 +223,10 @@
 mod
 plot(mod)
 mod <- radfit(BCI[1,])
+## Pre-emption model is a line
 plot(mod)
+## log for both axes: Zipf model is a line
+plot(mod, log = "xy")
 # Take a subset of BCI to save time and nerves
 mod <- radfit(BCI[2:5,])
 mod

Modified: branches/1.15/man/spantree.Rd
===================================================================
--- branches/1.15/man/spantree.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/spantree.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -35,9 +35,9 @@
     by \code{\link{scores}}.}
   \item{cex}{Character expansion factor.}
   \item{type}{Observations are plotted as points with
-    \code{type="p"} or \code{type="b"}, or as text with
+    \code{type="p"} or \code{type="b"}, or as text label with
     \code{type="t"}. The tree (lines) will always be plotted.}
-  \item{labels}{Text used with \code{type="t"} or row names if this is
+  \item{labels}{Text used with \code{type="t"} or node names if this is
     missing.}
   \item{dlim}{A ceiling value used to highest \code{cophenetic} dissimilarity.}
   \item{FUN}{Ordination function to find the configuration from
@@ -60,7 +60,7 @@
   the tree segments. Function \code{plot} displays the tree over a
   supplied ordination configuration, and \code{lines} adds a spanning
   tree to an ordination graph. If configuration is not supplied for \code{plot},
-  the function ordinates the the cophenetic dissimilarities of the
+  the function ordinates the cophenetic dissimilarities of the
   spanning tree and overlays the tree on this result. The default
   ordination function is \code{\link[MASS]{sammon}} (package \pkg{MASS}),
   because Sammon scaling emphasizes structure in the neighbourhood of
@@ -68,8 +68,7 @@
   to set \code{dlim}, and sometimes the results will remain
   twisted). These ordination methods do not work with disconnected
   trees, but you must supply the ordination configuration. Function
-  \code{lines} will overlay the tree in an existing 
-  plot. 
+  \code{lines} will overlay the tree in an existing plot. 
 
   Function \code{spantree} uses Prim's method
   implemented as priority-first search for dense graphs (Sedgewick
@@ -89,6 +88,7 @@
     and tree is disconnected at the node.}
   \item{dist }{Corresponding distance. If \code{kid = NA}, then
     \code{dist = 0}.}
+  \item{labels }{Names of nodes as found from the input dissimilarities.} 
 }
 \references{
  Sedgewick, R. (1990). \emph{Algorithms in C}. Addison Wesley. 

Modified: branches/1.15/man/specpool.Rd
===================================================================
--- branches/1.15/man/specpool.Rd	2009-03-27 07:13:56 UTC (rev 763)
+++ branches/1.15/man/specpool.Rd	2009-03-29 07:02:24 UTC (rev 764)
@@ -90,7 +90,7 @@
     the number 
     of individuals in rare species.
 
-    Functions estimate the the standard errors of the estimates. These
+    Functions estimate the standard errors of the estimates. These
     only concern the number of added species, and assume that there is
     no variance in the observed richness.
     The equations of standard errors are too complicated to be reproduced in



More information about the Vegan-commits mailing list