[Vegan-commits] r1387 - in branches/1.17: R inst man src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 1 20:46:23 CET 2010


Author: jarioksa
Date: 2010-12-01 20:46:21 +0100 (Wed, 01 Dec 2010)
New Revision: 1387

Modified:
   branches/1.17/R/anova.ccabyaxis.R
   branches/1.17/R/decorana.R
   branches/1.17/R/metaMDSdist.R
   branches/1.17/R/nestednodf.R
   branches/1.17/R/oecosimu.R
   branches/1.17/R/ordiellipse.R
   branches/1.17/R/ordilabel.R
   branches/1.17/R/plot.decorana.R
   branches/1.17/R/print.oecosimu.R
   branches/1.17/R/swan.R
   branches/1.17/R/treedive.R
   branches/1.17/inst/ChangeLog
   branches/1.17/man/nestedtemp.Rd
   branches/1.17/man/ordihull.Rd
   branches/1.17/man/ordilabel.Rd
   branches/1.17/man/treedive.Rd
   branches/1.17/src/
   branches/1.17/src/decorana.f
Log:
merge r1301 through 1331 to branches/1.17

Modified: branches/1.17/R/anova.ccabyaxis.R
===================================================================
--- branches/1.17/R/anova.ccabyaxis.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/anova.ccabyaxis.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -8,15 +8,11 @@
     if (is.null(object$terms)) 
         stop("Analysis is only possible for models fitted using formula")
     lc <- object$CCA$u
-    mf <- model.frame(object)
     ## Handle missing values in scores, both "omit" and "exclude" to
     ## match dims with data.
     if (!is.null(object$na.action)) {
         lc <- stats:::napredict.exclude(object$na.action, lc)
-        mf <- lapply(mf, function(x) stats:::napredict.exclude(object$na.action, x))
-        mf <- as.data.frame(mf)
     }
-    newdata <- cbind(lc, mf)
     axnam <- colnames(lc)
     df <- c(rep(1, rnk), object$CA$rank)
     chi <- c(object$CCA$eig, Residual = object$CA$tot.chi)
@@ -24,23 +20,23 @@
     nperm <- c(numeric(rnk), NA)
     Pval <- rep(NA, rnk+1)
     out <- data.frame(df, chi, Fval, nperm, Pval)
-    sol <- anova(object, first = TRUE, ...)
+    environment(object$terms) <- environment()
+    fla <- update(formula(object), . ~ lc[,1] + Condition(lc[,-1]))
+    sol <- anova(update(object, fla),  ...)
     out[c(1, rnk + 1), ] <- sol
     seed <- attr(sol, "Random.seed")
     attr(out, "names") <- attr(sol, "names")
-    attr(out, "heading") <- attr(sol, "heading")
+    .call <- pasteCall(object$call, "Model:")
+    attr(out, "heading") <- sub(" \n","", .call)
     attr(out, "Random.seed") <- seed
     bigseed <- get(".Random.seed", envir = .GlobalEnv, inherits = FALSE)
     bigperm <- out$N.Perm[1]
-    environment(object$terms) <- environment()
     if (rnk > 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)
+            fla <- update(formula(object),  .~ lc[, .ITRM] + Condition(lc[,-(.ITRM)]) )
+            sol <- update(object, fla)
             assign(".Random.seed", seed, envir = .GlobalEnv)
-            out[.ITRM, ] <- as.matrix(anova(sol, first = TRUE, ...))[1, 
+            out[.ITRM, ] <- as.matrix(anova(sol, ...))[1, 
                 ]
             if (out[.ITRM, "N.Perm"] > bigperm) {
                 bigperm <- out[.ITRM, "N.Perm"]

Modified: branches/1.17/R/decorana.R
===================================================================
--- branches/1.17/R/decorana.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/decorana.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -37,9 +37,9 @@
     }
     v <- attr(veg, "v")
     v.fraction <- attr(veg, "fraction")
-    adotj <- apply(veg, 2, sum)
+    adotj <- colSums(veg)
     adotj[adotj < Const3] <- Const3
-    aidot <- apply(veg, 1, sum)
+    aidot <- rowSums(veg)
     tot <- sum(adotj)
     yeig1 <- rep(1, nc)
     xeig1 <- rep(1, nr)

Modified: branches/1.17/R/metaMDSdist.R
===================================================================
--- branches/1.17/R/metaMDSdist.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/metaMDSdist.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -32,13 +32,14 @@
     call <- attr(dis, "call")
     call[[1]] <- as.name(distname)
     attr(dis, "call") <- call
-    if (any(dis <= 0)) {
+    if (any(dis <= 0, na.rm = TRUE)) {
         if (zerodist == "fail") 
             stop("Zero dissimilarities are not allowed")
         else if (zerodist == "add") {
-            zero <- min(dis[dis > 0])/2
+            zero <- min(dis[dis > 0], na.rm = TRUE)/2
             dis[dis <= 0] <- zero
-            warning("Zero dissimilarities changed into ", zero)
+            if (trace)
+                cat("Zero dissimilarities changed into ", zero,"\n")
         }
     }
     ## We actually used maxdis to decide whether index has a closed
@@ -50,13 +51,13 @@
     if (noshare > 0 && sum(tmp <- no.shared(comm))/length(dis) > noshare) {
         if (trace) 
             cat("Using step-across dissimilarities:\n")
-        rn <- range(dis[tmp])
+        rn <- range(dis[tmp], na.rm = TRUE)
         if (rn[2]/rn[1] > 1.01)
             warning("non-constant distances between points with nothing shared\n",
                     "  stepacross may be meaningless: consider argument 'noshare=0'")
         is.na(dis) <- tmp
         dis <- stepacross(dis, trace = trace, toolong=0, ...)
-        if (length(unique(distconnected(tmp, trace = trace > 1))) > 1) 
+        if (length(unique(distconnected(tmp, trace = trace))) > 1) 
             warning("Data are disconnected, results may be meaningless")
     }
     attr(dis, "maxdis") <- maxdis

Modified: branches/1.17/R/nestednodf.R
===================================================================
--- branches/1.17/R/nestednodf.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/nestednodf.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -1,44 +1,71 @@
 `nestednodf` <- 
-    function(comm, order = TRUE)
+    function(comm, order = TRUE, weighted = FALSE) 
 {
-    comm <- ifelse(comm > 0, 1, 0)
-    ## Order rows and columns
-    if (order)
-        comm <- comm[order(rowSums(comm), decreasing=TRUE),
-                     order(colSums(comm), decreasing=TRUE)]    
-    dimensions <- dim(comm)
-    fill <- sum(comm)/length(comm)
-    N.paired <- 0
-    ## Function to be applied to each combination of rows and columns
-    comb <- function(x, rows) {
-        if (identical(rows,TRUE)) {
-            comb.first <- comm[x[1],]
-            comb.second <- comm[x[2],]
+    bin.comm <- ifelse(comm > 0, 1, 0)
+    rfill <- rowSums(bin.comm)
+    cfill <- colSums(bin.comm)
+    if (order) {
+        if (weighted) {
+            rgrad <- rowSums(comm)
+            cgrad <- colSums(comm)
+            rorder <- order(rfill, rgrad, decreasing = TRUE)
+            corder <- order(cfill, cgrad, decreasing = TRUE)
+        } else {
+            rorder <- order(rfill, decreasing = TRUE)
+            corder <- order(cfill, decreasing = TRUE)
+            comm <- bin.comm
         }
-        else {
-            comb.first <- comm[,x[1]]
-            comb.second <- comm[,x[2]]
+        comm <- comm[rorder, corder]
+        rfill <- rfill[rorder]
+        cfill <- cfill[corder]
+    }
+    nr <- NROW(comm)
+    nc <- NCOL(comm)
+    fill <- sum(rfill)/length(comm)
+    N.paired.rows <- numeric(nr * (nr - 1)/2)
+    N.paired.cols <- numeric(nc * (nc - 1)/2)
+    counter <- 0
+    for (i in 1:(nr - 1)) {
+        first <- comm[i, ]
+        for (j in (i + 1):nr) {
+            counter <- counter + 1
+            if (rfill[i] <= rfill[j] || any(rfill[c(i, j)] == 0)) 
+                next
+            if (weighted) {
+                second <- comm[j, ]
+                N.paired.rows[counter] <-
+                    sum(first - second > 0 & second > 0)/sum(second > 0)
+            }
+            else {
+                N.paired.rows[counter] <-
+                    sum(first + comm[j, ] == 2)/rfill[j]
+            }
         }
-        ## if MTi > MTj
-        if (sum(comb.first) > sum(comb.second) && sum(comb.second) > 0) {
-            paired.overlap <- sum((comb.first + comb.second) == 2) /
-                sum(comb.second)
-            N.paired <- paired.overlap
+    }
+    counter <- 0
+    for (i in 1:(nc - 1)) {
+        first <- comm[, i]
+        for (j in (i + 1):nc) {
+            counter <- counter + 1
+            if (cfill[i] <= cfill[j] || any(cfill[c(i, j)] == 0)) 
+                next
+            if (weighted) {
+                second <- comm[, j]
+                N.paired.cols[counter] <-
+                    sum(first - second > 0 & second > 0)/sum(second > 0)
+            }
+            else {
+                N.paired.cols[counter] <-
+                    sum(first + comm[, j] == 2)/cfill[j]
+            }
         }
-        return(N.paired)
     }
-    ## N.paired for all combinations of columns and rows
-    N.paired.rows <- combn(1:dimensions[1],2, comb, rows=TRUE)
-    N.paired.columns <- combn(1:dimensions[2],2, comb, rows=FALSE)
-    ## Index calculations
-    N.columns <- mean(N.paired.columns) * 100
-    N.rows <- mean(N.paired.rows) * 100  
-    NODF <- (sum(c(N.paired.rows, N.paired.columns)) * 100) /
-        ((dimensions[2] * (dimensions[2] - 1) / 2) + 
-         (dimensions[1] * (dimensions[1] - 1) / 2))
-    ## Returned list
-    out <- list(comm = comm, fill = fill, 
-                statistic=c("N.columns" = N.columns, "N.rows" = N.rows, "NODF" = NODF))
+    N.columns <- mean(N.paired.cols) * 100
+    N.rows <- mean(N.paired.rows) * 100
+    NODF <- (sum(c(N.paired.rows, N.paired.cols)) * 100)/
+        ((nc * (nc - 1)/2) + (nr * (nr - 1)/2))
+    out <- list(comm = comm, fill = fill,
+                statistic = c(N.columns = N.columns, N.rows = N.rows, NODF = NODF))
     class(out) <- "nestednodf"
     return(out)
 }

Modified: branches/1.17/R/oecosimu.R
===================================================================
--- branches/1.17/R/oecosimu.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/oecosimu.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -20,8 +20,11 @@
         method <- "custom"
     }
     quant <- method %in% c("r2dtable", "custom")
+    ## binarize data with binary null models before getting statistics
+    if (!quant)
+        comm <- ifelse(comm > 0, 1, 0)
+    ind <- nestfun(comm, ...)
 
-    ind <- nestfun(comm, ...)
     if (is.list(ind))
         indstat <- ind[[statistic]]
     else
@@ -31,7 +34,6 @@
 
     ## permutation for binary data
     if (!quant) {
-        comm <- ifelse(comm > 0, 1, 0)
         if (method %in% c("swap", "tswap")){
             checkbrd <- 1
             if (method == "tswap") {
@@ -95,12 +97,16 @@
         }
     }
     ## end of addition
-    sd <- apply(simind, 1, sd)
-    z <- (indstat - rowMeans(simind))/sd
+    sd <- apply(simind, 1, sd, na.rm = TRUE)
+    z <- (indstat - rowMeans(simind, na.rm = TRUE))/sd
     if (any(sd < sqrt(.Machine$double.eps)))
         z[sd < sqrt(.Machine$double.eps)] <- 0
-    pless <- rowSums(indstat <= simind)
-    pmore <- rowSums(indstat >= simind)
+    pless <- rowSums(indstat <= simind, na.rm = TRUE)
+    pmore <- rowSums(indstat >= simind, na.rm = TRUE)
+    if (any(is.na(simind))) {
+        warning("some simulated values were NA and were removed")
+        nsimul <- nsimul - rowSums(is.na(simind))
+    }
     p <- switch(alternative,
                 two.sided = 2*pmin(pless, pmore),
                 less = pless,

Modified: branches/1.17/R/ordiellipse.R
===================================================================
--- branches/1.17/R/ordiellipse.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/ordiellipse.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -1,7 +1,7 @@
 "ordiellipse" <-
     function (ord, groups, display = "sites", kind = c("sd", "se"),
               conf, draw = c("lines", "polygon", "none"),
-              w = weights(ord, display),
+              w = weights(ord, display), col = NULL, 
               show.groups, label = FALSE,  ...)
 {
     weights.default <- function(object, ...) NULL
@@ -43,9 +43,12 @@
             else t <- sqrt(qchisq(conf, 2))
             xy <- veganCovEllipse(mat$cov, mat$center, t)
             if (draw == "lines")
-                ordiArgAbsorber(xy, FUN = lines, ...)
+                ordiArgAbsorber(xy, FUN = lines,
+                                col = if(is.null(col)) par("fg") else col,
+                                ...)
             else if (draw == "polygon") 
-                ordiArgAbsorber(xy[, 1], xy[, 2], FUN = polygon, ...)
+                ordiArgAbsorber(xy[, 1], xy[, 2], col = col, FUN = polygon,
+                                ...)
             if (label && draw != "none") {
                 cntrs <- rbind(cntrs, mat$center)
                 names <- c(names, is)
@@ -56,10 +59,11 @@
     }
     if (label && draw != "none") {
         if (draw == "lines")
-            ordiArgAbsorber(cntrs[,1], cntrs[,2], labels=names, 
+            ordiArgAbsorber(cntrs[,1], cntrs[,2], labels=names, col = col,  
                             FUN = text, ...)
-        else
-            ordiArgAbsorber(cntrs, labels = names, FUN = ordilabel, ...)
+        else 
+            ordiArgAbsorber(cntrs, labels = names, col = NULL,
+                            FUN = ordilabel, ...)
     }
     class(res) <- "ordiellipse"
     invisible(res)

Modified: branches/1.17/R/ordilabel.R
===================================================================
--- branches/1.17/R/ordilabel.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/ordilabel.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -1,6 +1,7 @@
 `ordilabel` <-
     function(x, display, labels, choices = c(1,2), priority,
-             cex = 0.8, fill = "white", border = NULL,  ...)
+             cex = 0.8, fill = "white", border = NULL, col = NULL,
+             ...)
 {
     if (missing(display))
         display <- "sites"
@@ -16,10 +17,15 @@
     ex <- strheight("x", cex = cex, ...)
     w <- (strwidth(labels, cex=cex,...) + em/1.5)/2
     h <- (strheight(labels, cex = cex, ...) + ex/1.5)/2
+    if (is.null(col))
+        if (!is.null(border))
+            col <- border
+        else
+            col <- par("fg")
     for (i in 1:nrow(x)) {
         polygon(x[i,1] + c(-1,1,1,-1)*w[i], x[i,2] + c(-1,-1,1,1)*h[i],
                 col = fill, border = border)
-        text(x[i,1], x[i,2], labels = labels[i], cex = cex, ...)
+        text(x[i,1], x[i,2], labels = labels[i], cex = cex, col = col, ...)
     }
     invisible(x)
 }

Modified: branches/1.17/R/plot.decorana.R
===================================================================
--- branches/1.17/R/plot.decorana.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/plot.decorana.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -61,12 +61,12 @@
         abline(v = x$origin[choices[1]], lty = 3)
     }
     if (type != "none" && (display == "both" || display == "sites")) {
-        if (type == "text") 
+        if (type == "text" && !is.null(sitnam)) 
             text(sites, sitnam, cex = cex, col = cols[1])
         else points(sites, cex = cex, col = cols[1])
     }
     if (type != "none" && (display == "both" || display == "species")) {
-        if (type == "text") 
+        if (type == "text" && !is.null(spenam)) 
             text(specs, spenam, cex = cex, col = cols[2])
         else points(specs, pch = "+", cex = cex, col = cols[2])
     }

Modified: branches/1.17/R/print.oecosimu.R
===================================================================
--- branches/1.17/R/print.oecosimu.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/print.oecosimu.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -25,10 +25,15 @@
                     two.sided = c(0.025, 0.5, 0.975),
                     less = c(0, 0.5, 0.95),
                     greater = c(0.05, 0.5, 1))
-    qu <- apply(x$oecosimu$simulated, 1, quantile, probs=probs)
+    qu <- apply(x$oecosimu$simulated, 1, quantile, probs=probs, na.rm = TRUE)
     m <- cbind("statistic" = x$oecosimu$statistic,
                "z" = x$oecosimu$z, t(qu),
                "Pr(sim.)"=x$oecosimu$pval)
     printCoefmat(m, ...)
+    if (any(is.na(x$oecosimu$simulated))) {
+        nacount <- rowSums(is.na(x$oecosimu$simulated))
+        cat("\nNumber of NA cases removed from simulations:\n",
+            nacount, "\n")
+    }
     invisible(x)   
 }

Modified: branches/1.17/R/swan.R
===================================================================
--- branches/1.17/R/swan.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/swan.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -1,7 +1,8 @@
 swan <-
 function (x)
 {
-    while(any(x == 0)) {
+    zeros <- -Inf
+    while(zeros != (zeros <- sum(x == 0)) && any(x == 0)) {
         x[x > 0] <- x[x > 0] - min(x[x > 0]) + 1
         x[x == 0] <- beals(x)[x == 0]
     }

Modified: branches/1.17/R/treedive.R
===================================================================
--- branches/1.17/R/treedive.R	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/R/treedive.R	2010-12-01 19:46:21 UTC (rev 1387)
@@ -28,9 +28,17 @@
     div <- numeric(nrow(comm))
     for (i in 1:nrow(comm)) {
         k <- comm[i,] > 0
-        d <- as.dist(m[k,k])
-        cl <- update(tree, d = d)
-        div[i] <- treeheight(cl)
+        nit <- sum(k)
+        ## Trivial cases of zero or one species
+        if (nit==0)
+            div[i] <- NA
+        else if (nit==1)
+            div[i] <- 0
+        else {
+            d <- as.dist(m[k,k])
+            cl <- update(tree, d = d)
+            div[i] <- treeheight(cl)
+        }
     }
     names(div) <- rownames(comm)
     div

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/inst/ChangeLog	2010-12-01 19:46:21 UTC (rev 1387)
@@ -13,13 +13,34 @@
 
 	* merge r1280: deviance.cca/rda return 0 in unconstrained
 	models.
-
 	* merge r1288:1290, 1305: rankindex takes a list of indices.
 
 	* merge r1296: example on unbiased Simpson in diversity.Rd.
 
 	* merge r1300, 1369:1371: FAQ and vignette updates.
 
+	* merge r1301:1304: metaMDSdist update.
+
+	* merge r1311: plot.decorana uses points if no text available. 
+
+	* merge r1313:1314: ordilabel and ordiellipse text uses border
+	colour. 
+
+	* merge r1315: fix swan infinite loop.
+
+	* merge r1319: decorana internal (rowSums/colSums)
+
+	* merge r1320: decorana prints warning.
+
+	* merge r1328, 1341: Gustavo Carvalho's nestednodf upgrade.
+
+	* merge r1329: treedive handles trivial trees.
+
+	* merge r1330:1331: oecosimu NA handling and takes care that
+	binary statistic is used with binary null models.
+
+	* merge r1332: anova.ccabyaxis really uses marginal models.
+
 Version 1.17-4 (released August 20, 2010)
 
 	* merged r1263: mrpp.Rd polish.

Modified: branches/1.17/man/nestedtemp.Rd
===================================================================
--- branches/1.17/man/nestedtemp.Rd	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/man/nestedtemp.Rd	2010-12-01 19:46:21 UTC (rev 1387)
@@ -26,7 +26,7 @@
 nestedn0(comm)
 nesteddisc(comm)
 nestedtemp(comm, ...)
-nestednodf(comm, order = TRUE)
+nestednodf(comm, order = TRUE, weighted = FALSE)
 \method{plot}{nestedtemp}(x, kind = c("temperature", "incidence"),
     col=rev(heat.colors(100)),  names = FALSE, ...)
 }
@@ -40,6 +40,7 @@
     If it is a logical vector of length 2, row and column labels are
     returned accordingly.}
   \item{order}{Order rows and columns by frequencies.}
+  \item{weighted}{Use species abundances as weights of interactions.}
   \item{\dots}{Other arguments to functions.}
 }
 
@@ -97,16 +98,20 @@
   Function \code{nestednodf} implements a nestedness metric based on
   overlap and decreasing fill (Almeida-Neto et al., 2008). Two basic
   properties are required for a matrix to have the maximum degree of
-  nestedness according to this metric: (1) complete overlap of 1's from
-  right to left columns and from down to up rows, and (2) decreasing
-  marginal totals between all pairs of columns and all pairs of
-  rows. The nestedness statistic is evaluated separately for columns
-  (\code{N columns}) for rows (\code{N rows}) and combined for the whole
-  matrix (\code{NODF}).  If you set \code{order = FALSE}, the statistic
-  is evaluated with the current matrix ordering allowing tests of other
-  meaningful hypothesis of matrix structure than ordering by row and
-  column totals (see Almeida-Neto et al. 2008).
-}
+  nestedness according to this metric: (1) complete overlap of 1's
+  from right to left columns and from down to up rows, and (2)
+  decreasing marginal totals between all pairs of columns and all
+  pairs of rows. The nestedness statistic is evaluated separately for
+  columns (\code{N columns}) for rows (\code{N rows}) and combined for
+  the whole matrix (\code{NODF}).  If you set \code{order = FALSE},
+  the statistic is evaluated with the current matrix ordering allowing
+  tests of other meaningful hypothesis of matrix structure than
+  default ordering by row and column totals (breaking ties by total
+  abundances when \code{weighted = TRUE}) (see Almeida-Neto et
+  al. 2008). With \code{weighted = TRUE}, the function finds the
+  weighted version of the index (Almeida-Neto & Ulrich,
+  2010). However, this requires quantitative null models for adequate
+  testing.}
 
 \value{
   The result returned by a nestedness function contains an item called
@@ -121,6 +126,10 @@
   \enc{Gumarães}{Gumaraes}, P.R., Loyola, R.D. & Ulrich, W. (2008). A
   consistent metric for nestedness analysis in ecological systems:
   reconciling concept and measurement. \emph{Oikos} 117, 1227--1239.
+
+  Almeida-Neto, M. & Ulrich, W. (2010). A straightforward
+  computational approac for measuring nestedness using quantitative
+  matrices. \emph{Env. Mod. Software} (in press).
   
   Atmar, W. & Patterson, B.D. (1993). The measurement of order and
   disorder in the distribution of species in fragmented

Modified: branches/1.17/man/ordihull.Rd
===================================================================
--- branches/1.17/man/ordihull.Rd	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/man/ordihull.Rd	2010-12-01 19:46:21 UTC (rev 1387)
@@ -27,7 +27,7 @@
          show.groups, label = FALSE,  ...)
 ordiellipse(ord, groups, display="sites", kind = c("sd","se"), conf,
          draw = c("lines","polygon", "none"), w = weights(ord, display),
-         show.groups, label = FALSE, ...)
+         col = NULL, show.groups, label = FALSE, ...)
 ordispider(ord, groups, display="sites", w = weights(ord, display),
          show.groups, label = FALSE, ...)
 ordiarrows(ord, groups, levels, replicates, display = "sites",
@@ -83,7 +83,10 @@
     2df. }
   \item{cluster}{Result of hierarchic cluster analysis, such as
     \code{\link{hclust}} or \code{\link[cluster]{agnes}}.}
-  \item{lty, col, lwd}{Line type, line colour and line width used for 
+  \item{col}{Colour of ellipses or ellipse fills in \code{ordiellipse}
+    or lines in \code{ordigrid}.  For other functions the effect depends
+    on the underlining functions this argument is passed to.}
+  \item{lty, lwd}{Line type, line width used for 
     \code{level}s and \code{replicate}s in \code{ordigrid}.}
   \item{prune}{Number of upper level hierarchies removed from the
     dendrogram. If \code{prune} \eqn{>0}, dendrogram will be

Modified: branches/1.17/man/ordilabel.Rd
===================================================================
--- branches/1.17/man/ordilabel.Rd	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/man/ordilabel.Rd	2010-12-01 19:46:21 UTC (rev 1387)
@@ -10,7 +10,7 @@
 }
 \usage{
 ordilabel(x, display, labels, choices = c(1, 2), priority, cex = 0.8,
-    fill = "white", border = NULL, ...)
+    fill = "white", border = NULL, col = NULL, ...)
 }
 
 \arguments{
@@ -26,6 +26,8 @@
         \code{\link{polygon}}).}
   \item{border}{The colour and visibility of the border of the label as defined in
          \code{\link{polygon}}).}
+  \item{col}{Text colour. Default \code{NULL} will give the value of
+    \code{border} or \code{par("fg")} if \code{border} is \code{NULL}.} 
   \item{\dots}{Other arguments (passed to \code{\link{text}}). }
 }
 \details{

Modified: branches/1.17/man/treedive.Rd
===================================================================
--- branches/1.17/man/treedive.Rd	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/man/treedive.Rd	2010-12-01 19:46:21 UTC (rev 1387)
@@ -35,13 +35,15 @@
   2002, 2006).
 
   Function \code{treedive} finds the \code{treeheight} for each site
-  (row) of a community matrix. The function uses a subset of dendrogram
-  for those species that occur in each site, and excludes the tree root
-  if that is not needed to connect the species (Petchey and Gaston
-  2006). The subset of the dendrogram is found by first calculating
-  \code{\link{cophenetic}} distances from the input dendrogram, then
-  reconstructing the dendrogram for the subset of the cophenetic
-  distance matrix for species occurring in each site.
+  (row) of a community matrix. The function uses a subset of
+  dendrogram for those species that occur in each site, and excludes
+  the tree root if that is not needed to connect the species (Petchey
+  and Gaston 2006). The subset of the dendrogram is found by first
+  calculating \code{\link{cophenetic}} distances from the input
+  dendrogram, then reconstructing the dendrogram for the subset of the
+  cophenetic distance matrix for species occurring in each
+  site. Diversity is 0 for one spcies, and \code{NA} for empty
+  communities.
 
   Function \code{treedist} finds the dissimilarities among
   trees. Pairwise dissimilarity of two trees is found by combining


Property changes on: branches/1.17/src
___________________________________________________________________
Deleted: svn:mergeinfo
   - 

Modified: branches/1.17/src/decorana.f
===================================================================
--- branches/1.17/src/decorana.f	2010-12-01 17:16:23 UTC (rev 1386)
+++ branches/1.17/src/decorana.f	2010-12-01 19:46:21 UTC (rev 1387)
@@ -149,6 +149,9 @@
       double precision xeig1(mi),xeig2(mi),xeig3(mi),aidot(mi),adotj(n)
       double precision qidat(nid)
       integer ibegin(mi),iend(mi),idat(nid),ix1(mi),ix2(mi),ix3(mi)
+c string to print R warnings: this must be long enough to fit format
+c statement 1012
+      character*64 warning
       tot=0.0
       do 10 j=1,n
       tot=tot+adotj(j)
@@ -297,6 +300,14 @@
 c      if(a12.gt.tol) write(*,1012) tol
 c 1012 format(1x,'*** beware ***     residual bigger than tolerance',
 c     1', which is',f10.6)
+c R version of the above warning. You must change the length of
+c character*n warning definition if you change the warning text
+      if (a12 .gt. tol) then
+         write(warning, 1012) a12, tol, neig+1
+ 1012    format("residual", f10.7, " bigger than tolerance", f10.7, 
+     1 " for axis ", i1)
+         call rwarn(warning)
+      end if
 c we calculate x from y, and set x to unit length if reciprocal
 c averaging option is in force (ira=1)
       call xmaxmi(y,aymax,aymin,n)



More information about the Vegan-commits mailing list