[Vegan-commits] r400 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 5 12:35:20 CEST 2008
Author: jarioksa
Date: 2008-06-05 12:35:20 +0200 (Thu, 05 Jun 2008)
New Revision: 400
Modified:
pkg/R/cca.default.R
pkg/R/print.cca.R
pkg/R/rda.default.R
Log:
fixed supefluous warnings of rank in conditioned (partial) cca/rda
Modified: pkg/R/cca.default.R
===================================================================
--- pkg/R/cca.default.R 2008-06-05 04:30:03 UTC (rev 399)
+++ pkg/R/cca.default.R 2008-06-05 10:35:20 UTC (rev 400)
@@ -56,7 +56,7 @@
sol <- svd(Y)
## rank of svd can be < qrank
rank <- min(rank, sum(sol$d > ZERO))
- if (rank < Q$rank)
+ if (rank < qrank)
warning("rank of QR decomposition > rank of svd: trouble ahead")
ax.names <- paste("CCA", 1:length(sol$d), sep = "")
colnames(sol$u) <- ax.names
@@ -132,4 +132,3 @@
class(sol) <- "cca"
sol
}
-
Modified: pkg/R/print.cca.R
===================================================================
--- pkg/R/print.cca.R 2008-06-05 04:30:03 UTC (rev 399)
+++ pkg/R/print.cca.R 2008-06-05 10:35:20 UTC (rev 400)
@@ -5,8 +5,13 @@
warning("this is an ade4 object which vegan cannot handle")
x <- ade2vegancca(x)
}
- if (!is.null(x$CCA) && 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)
+ if (!is.null(x$CCA)) {
+ qrank <- x$CCA$QR$rank
+ if (!is.null(x$pCCA))
+ qrank <- qrank - x$pCCA$rank
+ if (x$CCA$rank < qrank)
+ 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)
@@ -39,4 +44,3 @@
cat("\n")
invisible(x)
}
-
Modified: pkg/R/rda.default.R
===================================================================
--- pkg/R/rda.default.R 2008-06-05 04:30:03 UTC (rev 399)
+++ pkg/R/rda.default.R 2008-06-05 10:35:20 UTC (rev 400)
@@ -39,7 +39,7 @@
sol <- svd(Y)
## it can happen that rank < qrank
rank <- min(rank, sum(sol$d > ZERO))
- if (rank < Q$rank)
+ if (rank < qrank)
warning("rank of QR decomposition > rank of svd: trouble ahead")
sol$d <- sol$d/sqrt(NR)
ax.names <- paste("RDA", 1:length(sol$d), sep = "")
@@ -110,4 +110,3 @@
class(sol) <- c("rda", "cca")
sol
}
-
More information about the Vegan-commits
mailing list