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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 19 09:09:17 CET 2011


Author: jarioksa
Date: 2011-01-19 09:09:17 +0100 (Wed, 19 Jan 2011)
New Revision: 1466

Modified:
   pkg/vegan/DESCRIPTION
   pkg/vegan/R/plot.specaccum.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/specaccum.Rd
Log:
gained option to plot rarefied specaccum against individuals

Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION	2011-01-19 07:46:33 UTC (rev 1465)
+++ pkg/vegan/DESCRIPTION	2011-01-19 08:09:17 UTC (rev 1466)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.18-21
-Date: January 9, 2011
+Version: 1.18-22
+Date: January 19, 2011
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens, 
    Helene Wagner  

Modified: pkg/vegan/R/plot.specaccum.R
===================================================================
--- pkg/vegan/R/plot.specaccum.R	2011-01-19 07:46:33 UTC (rev 1465)
+++ pkg/vegan/R/plot.specaccum.R	2011-01-19 08:09:17 UTC (rev 1466)
@@ -1,25 +1,30 @@
-"plot.specaccum" <-
+`plot.specaccum` <-
     function(x, add = FALSE, ci = 2, ci.type = c("bar","line","polygon"), 
-             col = par("fg"), ci.col = col, ci.lty = 1, xlab = "Sites",
-             ylab = x$method, ylim, ...)
+             col = par("fg"), ci.col = col, ci.lty = 1, xlab,
+             ylab = x$method, ylim, xvar = c("sites", "individuals"), ...)
 {
+    xvar <- match.arg(xvar)
+    xaxvar <- x[[xvar]]
+    if (missing(xlab))
+        xlab <- paste(toupper(substring(xvar, 1, 1)),
+                              substring(xvar, 2), sep="")
     ci.type <- match.arg(ci.type)
     if (!add) {
         if (missing(ylim))
-            ylim<- c(1, max(x$richness, x$richness + ci*x$sd))
-        plot(x$sites, x$richness, xlab=xlab, ylab=ylab, ylim=ylim,
+            ylim <- c(1, max(x$richness, x$richness + ci*x$sd))
+        plot(xaxvar, x$richness, xlab=xlab, ylab=ylab, ylim=ylim,
              type="n", ...)
     }
     if (!is.null(x$sd) && ci)
         switch(ci.type,
-               bar = segments(x$sites, x$richness - ci*x$sd, x$sites,
+               bar = segments(xaxvar, x$richness - ci*x$sd, xaxvar,
                   x$richness + ci*x$sd, col=ci.col, lty=ci.lty, ...),
-               line = matlines(x$sites, x$richness + t(rbind(-ci,ci) %*% x$sd),
+               line = matlines(xaxvar, x$richness + t(rbind(-ci,ci) %*% x$sd),
                  col=ci.col, lty=ci.lty, ...),
-               polygon = polygon(c(x$sites, rev(x$sites)),
+               polygon = polygon(c(xaxvar, rev(xaxvar)),
                  c(x$richness - ci*x$sd, rev(x$richness + ci*x$sd)), col=ci.col,
                  lty=ci.lty,  ...)
                )
-    lines(x$sites, x$richness,col=col, ...)
+    lines(xaxvar, x$richness,col=col, ...)
     invisible()
 }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-01-19 07:46:33 UTC (rev 1465)
+++ pkg/vegan/inst/ChangeLog	2011-01-19 08:09:17 UTC (rev 1466)
@@ -2,8 +2,19 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
-Version 1.18-21 (opened January 9, 2011)
+Version 1.18-22 (opened January 19, 2011)
 
+	* specaccum: fixed typo -- 'individuals' instead of
+	'invidividuals'. plot() gained argument to use "individuals" as
+	x-axis instead of "sites" with method = "rarefaction"
+	
+Version 1.18-21 (closed January 19, 2011)
+
+	* Fixes bug report #945 at R-Forge: anova.cca should now work with
+	subset, missing data, functions of constraints (like log(x)),
+	constraints or subset variables in data=, attached data frames or
+	in working environments. 
+
 	* capscale: return additive constant ('ac') when 'add = TRUE'. 
 
 	* fitted.capscale, predict.rda: additive constant ('ac')

Modified: pkg/vegan/man/specaccum.Rd
===================================================================
--- pkg/vegan/man/specaccum.Rd	2011-01-19 07:46:33 UTC (rev 1465)
+++ pkg/vegan/man/specaccum.Rd	2011-01-19 08:09:17 UTC (rev 1466)
@@ -17,8 +17,8 @@
 specaccum(comm, method = "exact", permutations = 100,
           conditioned =TRUE, gamma = "jack1",  ...)
 \method{plot}{specaccum}(x, add = FALSE, ci = 2, ci.type = c("bar", "line", "polygon"), 
-    col = par("fg"), ci.col = col, ci.lty = 1, xlab = "Sites", 
-    ylab = x$method, ylim, ...)
+    col = par("fg"), ci.col = col, ci.lty = 1, xlab, 
+    ylab = x$method, ylim, xvar = c("sites", "individuals"), ...)
 \method{boxplot}{specaccum}(x, add = FALSE, ...)
 fitspecaccum(object, model, method = "random", ...)
 \method{plot}{fitspecaccum}(x, col = par("fg"), lty = 1, xlab = "Sites", 
@@ -54,8 +54,12 @@
     \code{"polygon"}.}
   \item{ci.lty}{Line type for confidence intervals or border of the
     \code{"polygon"}.}
-  \item{xlab,ylab}{Labels for \code{x} and \code{y} axis.}
+  \item{xlab,ylab}{Labels for \code{x} (defaults \code{xvar}) and
+    \code{y} axis.}
   \item{ylim}{the y limits of the plot.}
+  \item{xvar}{Variable used for the horizontal axis:
+    \code{"individuals"} can be used only with
+    \code{method = "rarefaction"}. }
   \item{object}{Either a community data set or fitted \code{specaccum} model.}
   \item{model}{Nonlinear regression model (\code{\link{nls}}). See Details.}
   \item{lty}{line type code (see \code{\link{par}}.}



More information about the Vegan-commits mailing list