[Vegan-commits] r909 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 9 07:55:15 CEST 2009


Author: jarioksa
Date: 2009-08-09 07:55:14 +0200 (Sun, 09 Aug 2009)
New Revision: 909

Modified:
   pkg/vegan/R/anova.cca.R
   pkg/vegan/R/anova.ccabyterm.R
   pkg/vegan/R/betadisper.R
   pkg/vegan/R/decorana.R
   pkg/vegan/R/ordicluster.R
   pkg/vegan/R/ordiellipse.R
   pkg/vegan/R/ordisurf.R
   pkg/vegan/R/points.cca.R
   pkg/vegan/R/read.cep.R
   pkg/vegan/R/text.cca.R
Log:
continue r908: remove backticks from messages to satisfy emacs

Modified: pkg/vegan/R/anova.cca.R
===================================================================
--- pkg/vegan/R/anova.cca.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/anova.cca.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -53,7 +53,7 @@
     head <- paste("Permutation test for", tst$method, "under", 
                   tst$model, "model\n")
     if (!is.null(tst$strata)) 
-        head <- paste(head, "Permutations stratified within `", 
+        head <- paste(head, "Permutations stratified within '", 
                       tst$strata, "'\n", sep = "")
     mod <- paste("Model:", c(object$call))
     structure(table, heading = c(head, mod), Random.seed = seed, 

Modified: pkg/vegan/R/anova.ccabyterm.R
===================================================================
--- pkg/vegan/R/anova.ccabyterm.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/anova.ccabyterm.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -56,7 +56,7 @@
     head <- paste("Permutation test for", sim$method, "under", 
                   sim$model, "model\nTerms added sequentially (first to last)\n")
     if (!is.null(sim$strata)) 
-        head <- paste(head, "Permutations stratified within `", 
+        head <- paste(head, "Permutations stratified within '", 
                       sim$strata, "'\n", sep = "")
     structure(out, heading = c(head, call), Random.seed = sim$Random.seed, 
               class = c("anova.cca", "anova", "data.frame"))

Modified: pkg/vegan/R/betadisper.R
===================================================================
--- pkg/vegan/R/betadisper.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/betadisper.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -51,6 +51,7 @@
     pos <- eig > 0
     ## group centroids in PCoA space
     centroids <- apply(vectors, 2, function(x) tapply(x, group, mean))
+    m <- table(group)[group]
     ## for each of the groups, calculate distance to centroid for
     ## observation in the group
     if(is.matrix(centroids)) {
@@ -77,7 +78,7 @@
         }
     }
     ## zij are the distances of each point to its group centroid
-    zij <- sqrt(abs(dist.pos - dist.neg))
+    zij <- sqrt(abs(dist.pos - dist.neg)*m/(m-1))
     ## add in correct labels
     colnames(vectors) <- names(eig) <- paste("PCoA", seq_along(eig), sep = "")
     if(is.matrix(centroids))
@@ -85,7 +86,7 @@
     else
         names(centroids) <- names(eig)
     rownames(vectors) <- names(zij) <- labs
-    retval <- list(eig = eig, vectors = vectors, distances = zij,
+    retval <- list(eig = eig, vectors = vectors, distances = zij*zij,
                    group = group, centroids = centroids, call = match.call())
     class(retval) <- "betadisper"
     attr(retval, "method") <- attr(d, "method")

Modified: pkg/vegan/R/decorana.R
===================================================================
--- pkg/vegan/R/decorana.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/decorana.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -23,9 +23,9 @@
         iresc <- 0
     if (!is.null(before)) {
         if (is.unsorted(before)) 
-            stop("`before' must be sorted")
+            stop("'before' must be sorted")
         if (length(before) != length(after)) 
-            stop("`before' and `after' must have same lengths")
+            stop("'before' and 'after' must have same lengths")
         for (i in 1:nr) {
             tmp <- veg[i, ] > 0
             veg[i, tmp] <- approx(before, after, veg[i, tmp], 

Modified: pkg/vegan/R/ordicluster.R
===================================================================
--- pkg/vegan/R/ordicluster.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/ordicluster.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -7,7 +7,7 @@
     mrg <- cluster$merge
     ord <- scores(ord, display = display, ...)
     if (nrow(mrg) != nrow(ord) - 1)
-        stop("Dimensions do not match in `ord' and `cluster'")
+        stop("Dimensions do not match in 'ord' and 'cluster'")
     if (length(w) == 1) w <- rep(w, nrow(ord))
     n <- if (is.null(w)) rep(1, nrow(ord)) else w
     go <- ord

Modified: pkg/vegan/R/ordiellipse.R
===================================================================
--- pkg/vegan/R/ordiellipse.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/ordiellipse.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -3,8 +3,7 @@
               conf, draw = c("lines", "polygon"), w = weights(ord, display),
               show.groups, ...)
 {
-    if (!require(ellipse))
-        stop("Requires package `ellipse' (from CRAN)")
+    require(ellipse) || stop("Requires package 'ellipse' (from CRAN)")
     weights.default <- function(object, ...) NULL
     kind <- match.arg(kind)
     draw <- match.arg(draw)

Modified: pkg/vegan/R/ordisurf.R
===================================================================
--- pkg/vegan/R/ordisurf.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/ordisurf.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -9,8 +9,7 @@
     w <- eval(w)
     if (!is.null(w) && length(w) == 1) 
         w <- NULL
-    if (!require(mgcv)) 
-        stop("Requires package `mgcv'")
+    require(mgcv)  || stop("Requires package 'mgcv'")
     X <- scores(x, choices = choices, display = display, ...)
     x1 <- X[, 1]
     x2 <- X[, 2]

Modified: pkg/vegan/R/points.cca.R
===================================================================
--- pkg/vegan/R/points.cca.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/points.cca.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -4,7 +4,7 @@
 {
     formals(arrows) <- c(formals(arrows), alist(... = ))
     if (length(display) > 1) 
-        stop("Only one `display' item can be added in one command.")
+        stop("Only one 'display' item can be added in one command.")
     pts <- scores(x, choices = choices, display = display, scaling = scaling,
                   const)
     if (!missing(select)) 

Modified: pkg/vegan/R/read.cep.R
===================================================================
--- pkg/vegan/R/read.cep.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/read.cep.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -3,7 +3,7 @@
             force = FALSE) 
 {
   if (!force) {
-    stop("R may crash: if you want to try, save your session and use `force=T'")
+    stop("R may crash: if you want to try, save your session and use 'force=TRUE'")
   }
   if (is.loaded("_gfortran_ioparm"))
       warning("It seems that you have used gfortran: the input may be corrupted\n")

Modified: pkg/vegan/R/text.cca.R
===================================================================
--- pkg/vegan/R/text.cca.R	2009-07-31 13:57:28 UTC (rev 908)
+++ pkg/vegan/R/text.cca.R	2009-08-09 05:55:14 UTC (rev 909)
@@ -4,7 +4,7 @@
 {
     formals(arrows) <- c(formals(arrows), alist(... = ))
     if (length(display) > 1) 
-        stop("Only one `display' item can be added in one command.")
+        stop("Only one 'display' item can be added in one command.")
     pts <- scores(x, choices = choices, display = display, scaling = scaling,
                   const)
     if (!missing(labels))



More information about the Vegan-commits mailing list