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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 28 15:09:39 CEST 2009


Author: jarioksa
Date: 2009-05-28 15:09:38 +0200 (Thu, 28 May 2009)
New Revision: 833

Modified:
   branches/1.15/DESCRIPTION
   branches/1.15/R/anova.ccabyaxis.R
   branches/1.15/R/anova.ccabymargin.R
   branches/1.15/R/anova.ccabyterm.R
   branches/1.15/R/kendall.global.R
   branches/1.15/R/ordilattice.getEnvfit.R
   branches/1.15/R/orditkplot.R
   branches/1.15/R/ordixyplot.R
   branches/1.15/R/panel.ordi.R
   branches/1.15/R/taxa2dist.R
   branches/1.15/inst/ChangeLog
   branches/1.15/man/metaMDS.Rd
Log:
merged some fixes between r809 andr832 to branches for possible 1.15-3 release

Modified: branches/1.15/DESCRIPTION
===================================================================
--- branches/1.15/DESCRIPTION	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/DESCRIPTION	2009-05-28 13:09:38 UTC (rev 833)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.15-2
-Date: April 15, 2009
+Version: 1.15-3
+Date: May 28, 2009
 Author: Jari Oksanen, Roeland Kindt, Pierre Legendre, Bob O'Hara, Gavin L. Simpson, 
    Peter Solymos, M. Henry H. Stevens, Helene Wagner  
 Maintainer: Jari Oksanen <jari.oksanen at oulu.fi>

Modified: branches/1.15/R/anova.ccabyaxis.R
===================================================================
--- branches/1.15/R/anova.ccabyaxis.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/anova.ccabyaxis.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -26,20 +26,20 @@
     bigperm <- out$N.Perm[1]
     environment(object$terms) <- environment()
     if (rnk > 1) {
-        for (i in 2:rnk) {
-            zz <- paste(paste("Condition(", axnam[1:(i - 1)], 
+        for (.ITRM in 2:rnk) {
+            zz <- paste(paste("Condition(", axnam[1:(.ITRM - 1)], 
                 ")"), collapse = "+")
             fla <- update(formula(object), paste(". ~ . +", zz))
             sol <- update(object, fla, data = newdata)
             assign(".Random.seed", seed, envir = .GlobalEnv)
-            out[i, ] <- as.matrix(anova(sol, first = TRUE, ...))[1, 
+            out[.ITRM, ] <- as.matrix(anova(sol, first = TRUE, ...))[1, 
                 ]
-            if (out[i, "N.Perm"] > bigperm) {
-                bigperm <- out[i, "N.Perm"]
+            if (out[.ITRM, "N.Perm"] > bigperm) {
+                bigperm <- out[.ITRM, "N.Perm"]
                 bigseed <- get(".Random.seed", envir = .GlobalEnv, 
                   inherits = FALSE)
             }
-            if (out[i, "Pr(>F)"] > cutoff)
+            if (out[.ITRM, "Pr(>F)"] > cutoff)
                 break
         }
     }

Modified: branches/1.15/R/anova.ccabymargin.R
===================================================================
--- branches/1.15/R/anova.ccabymargin.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/anova.ccabymargin.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -10,12 +10,12 @@
     trms <- trms[keep]
     ntrms <- length(trms)
     bigperm <- 0
-    for (i in 1:ntrms) {
+    for (.ITRM in 1:ntrms) {
         fla <- formula(object)
         ## Put all trms except current into Condition() and update
         ## formula
         if (length(alltrms) > 1) {
-            keeptrms <- alltrms[!(alltrms==trms[i])]
+            keeptrms <- alltrms[!(alltrms==trms[.ITRM])]
             updfla <- paste("Condition(",paste(keeptrms, collapse="+"), ")")
             fla <- update(fla, paste(". ~ . + ", updfla))
         }
@@ -29,12 +29,12 @@
             bigseed <- get(".Random.seed", envir = .GlobalEnv,
                            inherits = FALSE)
         }
-        if (i == 1) {
+        if (.ITRM == 1) {
             seed <- attr(tmp, "Random.seed")
             sol <- tmp
         }
         else {
-            sol <- rbind(sol[1:(i-1),], as.matrix(tmp[1,]), sol[i,])
+            sol <- rbind(sol[1:(.ITRM-1),], as.matrix(tmp[1,]), sol[.ITRM,])
         }
         assign(".Random.seed", seed, envir = .GlobalEnv)
     }

Modified: branches/1.15/R/anova.ccabyterm.R
===================================================================
--- branches/1.15/R/anova.ccabyterm.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/anova.ccabyterm.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -21,21 +21,21 @@
     pchi[ntrm, ] <- sim$num
     df[ntrm:(ntrm + 1)] <- sim$df
     chi[ntrm:(ntrm + 1)] <- sim$chi
-    for (i in ntrm:2) {
+    for (.ITRM in ntrm:2) {
         if (ntrm < 2) 
             break
         assign(".Random.seed", sim$Random.seed, envir = .GlobalEnv)
-        fla <- as.formula(paste(" . ~ . -", trmlab[i]))
+        fla <- as.formula(paste(" . ~ . -", trmlab[.ITRM]))
         object <- update(object, fla)
         if (is.null(object$CCA)) 
             break
         sim <- permutest.cca(object, permutations = step, ...)
-        pchi[i, ] <- pchi[i, ] - sim$num
-        chi[i] <- chi[i] - sim$chi[1]
-        df[i] <- df[i] - sim$df[1]
-        pchi[i - 1, ] <- sim$num
-        chi[i - 1] <- sim$chi[1]
-        df[i - 1] <- sim$df[1]
+        pchi[.ITRM, ] <- pchi[.ITRM, ] - sim$num
+        chi[.ITRM] <- chi[.ITRM] - sim$chi[1]
+        df[.ITRM] <- df[.ITRM] - sim$df[1]
+        pchi[.ITRM - 1, ] <- sim$num
+        chi[.ITRM - 1] <- sim$chi[1]
+        df[.ITRM - 1] <- sim$df[1]
     }
     Fval <- chi/df/(chi[ntrm + 1]/df[ntrm + 1])
     Fval[ntrm + 1] <- NA

Modified: branches/1.15/R/kendall.global.R
===================================================================
--- branches/1.15/R/kendall.global.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/kendall.global.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -47,7 +47,8 @@
         p.i <- n.per.gr[i]
         if(p.i < 2) stop("There is a single variable in group ",gr.lev[i])
         ##CC# Correction factors for tied ranks (eq. 3.3)
-        t.ranks <- apply(R[,gr[[i]]], 2, function(x) summary(as.factor(x)))
+        t.ranks <- apply(R[,gr[[i]]], 2,
+                         function(x) summary(as.factor(x), maxsum=n))
         T. <- sum(unlist(lapply(t.ranks, function(x) sum((x^3)-x))))
 	
         ##CC# Compute the Sum of squares of the uncentred ranks (S) (eq. 3.1)

Modified: branches/1.15/R/ordilattice.getEnvfit.R
===================================================================
--- branches/1.15/R/ordilattice.getEnvfit.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/ordilattice.getEnvfit.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -1,7 +1,7 @@
 `ordilattice.getEnvfit` <-
     function(formula, object, envfit, choices = 1:3,  ...)
 {
-    if (!missing(envfit))
+    if (!missing(envfit) && !is.null(envfit))
         object <- envfit
     bp <- scores(object, display = "bp", choices = choices)
     cn <- scores(object, display = "cn",  choices = choices)

Modified: branches/1.15/R/orditkplot.R
===================================================================
--- branches/1.15/R/orditkplot.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/orditkplot.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -323,9 +323,9 @@
     labfnt <- labfnt[take]
     ## Ranges and pretty values for axes
     if (missing(xlim))
-        xlim <- range(sco[,1])
+        xlim <- range(sco[,1], na.rm = TRUE)
     if (missing(ylim))
-        ylim <- range(sco[,2])
+        ylim <- range(sco[,2], na.rm = TRUE)
     xpretty <- pretty(xlim)
     ypretty <- pretty(ylim)
     ## Extend ranges by 4% 

Modified: branches/1.15/R/ordixyplot.R
===================================================================
--- branches/1.15/R/ordixyplot.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/ordixyplot.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -15,6 +15,8 @@
       formula <- as.formula(paste(v[2], "~", v[1]))
     }
   if ("biplot" %in% type && (!is.null(x$CCA) || !missing(envfit))) {
+    if (missing(envfit))
+      envfit <- NULL
     env <- localOrdilattice.getEnvfit(formula, x, envfit, choices, ...)
     if (!is.null(env$arrows)) {
       mul <- apply(p[,colnames(env$arrows)], 2, range)/apply(env$arrows, 2, range)

Modified: branches/1.15/R/panel.ordi.R
===================================================================
--- branches/1.15/R/panel.ordi.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/panel.ordi.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -4,11 +4,11 @@
     panel.xyplot(x, y, type = type,  ...)
     tp <- trellis.par.get()
     if ("biplot" %in% type && !is.null(biplot$arrows)) {
-        panel.arrows(0, 0, biplot$arrows[,1], biplot$arrows[,2],
+        panel.arrows(0, 0, biplot$arrows[,2], biplot$arrows[,1],
                      col=tp$superpose.symbol$col, ...)
     }
     if ("biplot" %in% type && !is.null(biplot$centres)) {
-        panel.xyplot(biplot$centres[,1], biplot$centres[,2],
+        panel.xyplot(biplot$centres[,2], biplot$centres[,1],
                      col = tp$plot.symbol$col, 
                      pch = "+", cex = 3*tp$plot.symbol$cex, lwd=2,
                      ...)

Modified: branches/1.15/R/taxa2dist.R
===================================================================
--- branches/1.15/R/taxa2dist.R	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/R/taxa2dist.R	2009-05-28 13:09:38 UTC (rev 833)
@@ -37,7 +37,7 @@
             warning("Labels are wrong: needed ", nrow(x), " got ", length(labels))
         attr(out, "Labels") <- as.character(labels)
     }
-    if (!check && any(out) <= 0)
+    if (!check && any(out <= 0))
         warning("you used 'check=FALSE' and some distances are zero -- was this intended?")
     out
 }

Modified: branches/1.15/inst/ChangeLog
===================================================================
--- branches/1.15/inst/ChangeLog	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/inst/ChangeLog	2009-05-28 13:09:38 UTC (rev 833)
@@ -3,6 +3,26 @@
 
 VEGAN STABLE VERSIONS
 
+Version 1.15-3 (opened 28 May, 2009)
+
+	* merged r832: wrong reference in metaMDS.Rd.
+	
+	* merged r827: kendall.global: could get wrong counts of ties in
+	large data sets.
+	
+	* merged r823: fixed wrong test of output validity in taxa2dist.
+	
+	* merged r815: anova.cca(..., by = ) name clash if data were
+	indexed with 'i' in fitted model.
+	
+	* merged r812: ordixyplot mixed x and y axes for biplot arrows and
+	env centres.
+
+	* merged r811: orditkplot copes with NA and NaN scores.
+	
+	* merged r810: ordixyplot failed in constrained ordination (broken
+	in r108 in Nov 2007).
+
 Version 1.15-2 (released to CRAN: 15 April, 2009)
 
 	* spantree.Rd: example plots use type = "t". Parallel change with

Modified: branches/1.15/man/metaMDS.Rd
===================================================================
--- branches/1.15/man/metaMDS.Rd	2009-05-27 16:15:25 UTC (rev 832)
+++ branches/1.15/man/metaMDS.Rd	2009-05-28 13:09:38 UTC (rev 833)
@@ -223,8 +223,8 @@
   distance. \emph{Vegetatio} 69, 57--68.
 
   Minchin, P.R. (1987)  An evaluation of relative robustness
-  of techniques for ecological ordinations. \emph{Vegetatio} 71,
-  145-156.
+  of techniques for ecological ordinations. \emph{Vegetatio} 69,
+  89--107.
 }
 
 \author{ Jari Oksanen }



More information about the Vegan-commits mailing list