[Vegan-commits] r397 - in branches/1.13: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 5 05:55:03 CEST 2008
Author: jarioksa
Date: 2008-06-05 05:55:03 +0200 (Thu, 05 Jun 2008)
New Revision: 397
Modified:
branches/1.13/R/print.cca.R
branches/1.13/inst/ChangeLog
branches/1.13/inst/NEWS
Log:
r396 merged to branches/1.13
Modified: branches/1.13/R/print.cca.R
===================================================================
--- branches/1.13/R/print.cca.R 2008-06-05 03:39:30 UTC (rev 396)
+++ branches/1.13/R/print.cca.R 2008-06-05 03:55:03 UTC (rev 397)
@@ -1,35 +1,41 @@
-"print.cca" <-
- function (x, digits = max(3, getOption("digits") - 3), ...)
+`print.cca` <-
+ function (x, digits = max(3, getOption("digits") - 3), ...)
{
- cat("\nCall:\n")
- cat(deparse(x$call), "\n\n")
- chi <- rbind(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi)
- rnk <- rbind(NA, x$pCCA$rank, x$CCA$rank, x$CA$rank)
- tbl <- cbind(chi, rnk)
- tbl <- cbind(chi, rnk)
- colnames(tbl) <- c("Inertia", "Rank")
- rn <- c("Total", "Conditional", "Constrained", "Unconstrained")
- rownames(tbl) <- rn[c(TRUE, !is.null(x$pCCA), !is.null(x$CCA),
- !is.null(x$CA))]
- printCoefmat(tbl, digits = digits, na.print = "")
- cat("Inertia is", x$inertia, "\n")
- if (!is.null(x$CCA$alias))
- cat("Some constraints were aliased because they were collinear (redundant)\n")
- if (!is.null(x$CCA)) {
- cat("\nEigenvalues for constrained axes:\n")
- print(x$CCA$eig, digits = digits, ...)
- }
- if (!is.null(x$CA)) {
- ax.lim <- 8
- ax.trig <- 16
- cat("\nEigenvalues for unconstrained axes:\n")
- if (x$CA$rank > ax.trig) {
- print(x$CA$eig[1:ax.lim], digits = digits, ...)
- cat("(Showed only", ax.lim, "of all", x$CA$rank,
- "unconstrained eigenvalues)\n")
+ if (inherits(x, "pcaiv")) {
+ stop("this is an ade4 object which vegan cannot handle")
}
- else print(x$CA$eig, digits = digits, ...)
- }
- cat("\n")
- invisible(x)
+ if (x$CCA$rank < x$CCA$QR$rank)
+ warning("rank of constraints higher than the rank of dependent data\nvegan may not handle this -- wait for a bug fix release", call. = FALSE)
+ cat("\nCall:\n")
+ cat(deparse(x$call), "\n\n")
+ chi <- rbind(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi)
+ rnk <- rbind(NA, x$pCCA$rank, x$CCA$rank, x$CA$rank)
+ tbl <- cbind(chi, rnk)
+ tbl <- cbind(chi, rnk)
+ colnames(tbl) <- c("Inertia", "Rank")
+ rn <- c("Total", "Conditional", "Constrained", "Unconstrained")
+ rownames(tbl) <- rn[c(TRUE, !is.null(x$pCCA), !is.null(x$CCA),
+ !is.null(x$CA))]
+ printCoefmat(tbl, digits = digits, na.print = "")
+ cat("Inertia is", x$inertia, "\n")
+ if (!is.null(x$CCA$alias))
+ cat("Some constraints were aliased because they were collinear (redundant)\n")
+ if (!is.null(x$CCA)) {
+ cat("\nEigenvalues for constrained axes:\n")
+ print(x$CCA$eig, digits = digits, ...)
+ }
+ if (!is.null(x$CA)) {
+ ax.lim <- 8
+ ax.trig <- 16
+ cat("\nEigenvalues for unconstrained axes:\n")
+ if (x$CA$rank > ax.trig) {
+ print(x$CA$eig[1:ax.lim], digits = digits, ...)
+ cat("(Showed only", ax.lim, "of all", x$CA$rank,
+ "unconstrained eigenvalues)\n")
+ }
+ else print(x$CA$eig, digits = digits, ...)
+ }
+ cat("\n")
+ invisible(x)
}
+
Modified: branches/1.13/inst/ChangeLog
===================================================================
--- branches/1.13/inst/ChangeLog 2008-06-05 03:39:30 UTC (rev 396)
+++ branches/1.13/inst/ChangeLog 2008-06-05 03:55:03 UTC (rev 397)
@@ -5,6 +5,10 @@
Version 1.13-1 (opened May 22, 2008)
+ * merged r396: cca/rda/capscale print issues a warning when rank
+ of constraints+conditions < rank of dependent data, because vegan
+ cannot handle these cases properly.
+
* merged mso revisions since r372: now similar as in devel branch
at r389.
Modified: branches/1.13/inst/NEWS
===================================================================
--- branches/1.13/inst/NEWS 2008-06-05 03:39:30 UTC (rev 396)
+++ branches/1.13/inst/NEWS 2008-06-05 03:55:03 UTC (rev 397)
@@ -7,6 +7,12 @@
- Helene Wagner joined the vegan team.
+ - cca, rda, capscale issue a warning when the rank of the
+ constraints + condition is lower than the rank of the depedent
+ (community) data, because vegan is not prepared to handle these
+ cases properly. This is an ancient issue, but surfaced recently.
+ A real fix is expected in next releases.
+
- intersetcor and inertcomp now check that input really is from
constrained ordination instead of giving obscure error messages.
More information about the Vegan-commits
mailing list