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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 5 13:34:47 CET 2013


Author: jarioksa
Date: 2013-12-05 13:34:46 +0100 (Thu, 05 Dec 2013)
New Revision: 2808

Modified:
   branches/2.0/R/plot.renyiaccum.R
   branches/2.0/R/print.oecosimu.R
   branches/2.0/R/renyiaccum.R
   branches/2.0/inst/ChangeLog
   branches/2.0/man/nobs.adonis.Rd
   branches/2.0/man/renyi.Rd
   branches/2.0/man/screeplot.cca.Rd
Log:
merge revs in range 2678 to 2713 to 2.0-10

Modified: branches/2.0/R/plot.renyiaccum.R
===================================================================
--- branches/2.0/R/plot.renyiaccum.R	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/R/plot.renyiaccum.R	2013-12-05 12:34:46 UTC (rev 2808)
@@ -1,12 +1,15 @@
 `plot.renyiaccum` <-
-function (x, what=c("mean", "Qnt 0.025", "Qnt 0.975"), type = "l", ...) 
+function (x, what=c("Collector", "mean", "Qnt 0.025", "Qnt 0.975"),
+          type = "l", ...) 
 {
-	if (any(what %in% colnames(x[,1,])))
-	    x <- x[,,what]
+        what <- what[what %in% dimnames(x)[[3]]]
+	if (any(what %in% dimnames(x)[[3]]))
+	    x <- x[,,what, drop = FALSE]
 	dm <- dim(x)
-	lin <- rep(colnames(x[,1,]), each=dm[1]*dm[2])
+        dnam <- dimnames(x)
+	lin <- rep(dnam[[3]], each=dm[1]*dm[2])
 	Sites <- rep(1:dm[1], len=prod(dm))
-	alp <- factor(rownames(x[1,,]), levels=rownames(x[1,,]))
+	alp <- factor(dnam[[2]], levels=dnam[[2]])
 	alpha <- rep(rep(alp, each=dm[1]), len=prod(dm))
 	Diversity <- as.vector(x)
 	xyplot(Diversity ~ Sites | alpha, groups=lin, type=type, ...)

Modified: branches/2.0/R/print.oecosimu.R
===================================================================
--- branches/2.0/R/print.oecosimu.R	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/R/print.oecosimu.R	2013-12-05 12:34:46 UTC (rev 2808)
@@ -28,8 +28,8 @@
     }
     probs <- switch(x$oecosimu$alternative,
                     two.sided = c(0.025, 0.5, 0.975),
-                    less = c(0, 0.5, 0.95),
-                    greater = c(0.05, 0.5, 1))
+                    greater = c(0, 0.5, 0.95),
+                    less = c(0.05, 0.5, 1))
     qu <- apply(x$oecosimu$simulated, 1, quantile, probs=probs, na.rm = TRUE)
     m <- cbind("statistic" = x$oecosimu$statistic,
                "z" = x$oecosimu$z, "mean" = x$oecosimu$means, t(qu),

Modified: branches/2.0/R/renyiaccum.R
===================================================================
--- branches/2.0/R/renyiaccum.R	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/R/renyiaccum.R	2013-12-05 12:34:46 UTC (rev 2808)
@@ -1,6 +1,6 @@
 `renyiaccum` <-
 function(x, scales=c(0, 0.5, 1, 2, 4, Inf), permutations = 100,
-         raw = FALSE, subset, ...)
+         raw = FALSE, collector = FALSE, subset, ...)
 {
     if (!missing(subset))
         x <- subset(x, subset)
@@ -20,12 +20,16 @@
         result[,,k] <- as.matrix(renyi((apply(x[sample(n),],2,cumsum)),
                                        scales=scales, ...))
     }
+    if (raw)
+        collector <- FALSE
+    if (collector)
+        ref <- as.matrix(renyi(apply(x, 2, cumsum), scales = scales, ...))
     if (raw) {
         if (m==1) {
             result <- result[,1,]
         }
     }else{
-        tmp <- array(dim=c(n,m,6))
+        tmp <- array(dim=c(n,m,6 + as.numeric(collector)))
         for (i in 1:n) {
             for (j in 1:m) {
                 tmp[i,j,1] <- mean(result[i,j,1:permutations]) 
@@ -34,12 +38,14 @@
                 tmp[i,j,4] <- max(result[i,j,1:permutations])
                 tmp[i,j,5] <- quantile(result[i,j,1:permutations],0.025)
                 tmp[i,j,6] <- quantile(result[i,j,1:permutations],0.975)
+                if (collector)
+                    tmp[i,j,7] <- ref[i,j]
             }
         }
         result <- tmp
         dimnames(result) <- list(pooled.sites=c(1:n),
                                   scale=scales,
-                                  c("mean", "stdev", "min", "max", "Qnt 0.025", "Qnt 0.975"))
+                                  c("mean", "stdev", "min", "max", "Qnt 0.025", "Qnt 0.975", if (collector) "Collector"))
     }
     class(result) <- c("renyiaccum", class(result))
     result

Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/inst/ChangeLog	2013-12-05 12:34:46 UTC (rev 2808)
@@ -4,6 +4,11 @@
 
 Version 2.0-10 (opened December 5, 2013)
 
+	* merge 2713 man/: remove references to very old R versions in man
+	files (R/ part of this rev not applied)
+	* merge 2708: adapt quantilesto test direction.
+	* merge 2679: add collector curve to renyiaccum.
+	* merge 2678: renyiaccum can plot one scale. 
 	* merge 2641: subset in renyi/spec/tsallisaccum.
 	* merge 2630,1,2: fisherfit new algo and delete profile & confint.
 	* merge 2628,9: plot vectorfit *should* work with constant

Modified: branches/2.0/man/nobs.adonis.Rd
===================================================================
--- branches/2.0/man/nobs.adonis.Rd	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/man/nobs.adonis.Rd	2013-12-05 12:34:46 UTC (rev 2808)
@@ -31,14 +31,15 @@
 }
 }
 
-\details{ Function \code{nobs} is generic in \R version 2.13.0, and
+\details{ Function \code{nobs} is generic in \R, and
   \pkg{vegan} provides methods for objects from \code{\link{adonis}},
   \code{\link{betadisper}}, \code{\link{cca}} and other related
   methods, \code{\link{CCorA}}, \code{\link{decorana}},
   \code{\link{isomap}}, \code{\link{metaMDS}}, \code{\link{pcnm}},
   \code{\link{procrustes}}, \code{\link{radfit}},
-  \code{\link{varpart}} and \code{\link{wcmdscale}}.  } \value{ A
-  single number, normally an integer, giving the number of
+  \code{\link{varpart}} and \code{\link{wcmdscale}}.  }
+
+\value{ A single number, normally an integer, giving the number of
   observations.  }
 
 \author{

Modified: branches/2.0/man/renyi.Rd
===================================================================
--- branches/2.0/man/renyi.Rd	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/man/renyi.Rd	2013-12-05 12:34:46 UTC (rev 2808)
@@ -18,8 +18,9 @@
    hill = FALSE)
 \method{plot}{renyi}(x, ...)
 renyiaccum(x, scales = c(0, 0.5, 1, 2, 4, Inf), permutations = 100, 
-    raw = FALSE, subset, ...)
-\method{plot}{renyiaccum}(x, what = c("mean", "Qnt 0.025", "Qnt 0.975"), type = "l", 
+    raw = FALSE, collector = FALSE, subset, ...)
+\method{plot}{renyiaccum}(x, what = c("Collector", "mean", "Qnt 0.025", "Qnt 0.975"),
+    type = "l", 
     ...)
 \method{persp}{renyiaccum}(x, theta = 220, col = heat.colors(100), zlim, ...)
 rgl.renyiaccum(x, rgl.height = 0.2, ...)
@@ -34,6 +35,10 @@
   \item{raw}{if \code{FALSE} then return summary statistics of
     permutations, and if \code{TRUE} then returns the individual
     permutations.}
+  \item{collector}{Accumulate the diversities in the order the sites are
+    in the data set, and the collector curve can be plotted against
+    summary of permutations. The argument is ignored if \code{raw = TRUE}.
+  }
   \item{subset}{logical expression indicating sites (rows) to keep: missing
     values are taken as \code{FALSE}.}
   \item{what}{Items to be plotted.}

Modified: branches/2.0/man/screeplot.cca.Rd
===================================================================
--- branches/2.0/man/screeplot.cca.Rd	2013-12-05 11:50:52 UTC (rev 2807)
+++ branches/2.0/man/screeplot.cca.Rd	2013-12-05 12:34:46 UTC (rev 2808)
@@ -116,10 +116,7 @@
   Legendre, P. and Legendre, L. (2012) \emph{Numerical Ecology}. 3rd English
   ed. Elsevier.
   }
-\note{Function \code{screeplot} is generic from \code{R} version
-  2.5.0. In these versions you can use plain \code{screeplot} command
-  without suffices \code{cca}, \code{prcomp} etc.
-  }
+
 \author{Gavin L. Simpson}
 \seealso{
   \code{\link{cca}}, \code{\link{decorana}}, \code{\link{princomp}} and



More information about the Vegan-commits mailing list