[Vegan-commits] r2796 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Dec 3 17:02:58 CET 2013
Author: jarioksa
Date: 2013-12-03 17:02:58 +0100 (Tue, 03 Dec 2013)
New Revision: 2796
Modified:
pkg/vegan/R/anova.ccalist.R
pkg/vegan/R/anovacca.R
pkg/vegan/R/anovacca.byterm.R
Log:
adopt column header Variance/ChiSquare to ordination method
Modified: pkg/vegan/R/anova.ccalist.R
===================================================================
--- pkg/vegan/R/anova.ccalist.R 2013-12-03 15:39:14 UTC (rev 2795)
+++ pkg/vegan/R/anova.ccalist.R 2013-12-03 16:02:58 UTC (rev 2796)
@@ -72,13 +72,18 @@
## collect table
table <- data.frame(resdf, resdev, c(NA, df),
c(NA,changedev), c(NA,fval), c(NA,pval))
- dimnames(table) <- list(1L:nmodels, c("Resid. Df", "Res. Chisq",
- "Df", "Chisq", "F", "Pr(>F)"))
+ isRDA <- method != "cca"
+ dimnames(table) <- list(1L:nmodels,
+ c("Res.Df",
+ ifelse(isRDA,"Res.Variance", "Res.ChiSquare"),
+ "Df",
+ ifelse(isRDA,"Variance","ChiSquare"),
+ "F", "Pr(>F)"))
## Collect header information
formulae <- sapply(object, function(z) deparse(formula(z)))
head <- paste0("Permutation tests for ", method, " under ",
- mods[[big]]$model, " model\nwith ", nperm,
- " permutations\n")
+ mods[[big]]$model, " model\n",
+ howHead(attr(permutations, "control")))
topnote <- paste("Model ", format(1L:nmodels), ": ", formulae,
sep = "", collapse = "\n")
structure(table, heading=c(head,topnote), class = c("anova", "data.frame"))
Modified: pkg/vegan/R/anovacca.R
===================================================================
--- pkg/vegan/R/anovacca.R 2013-12-03 15:39:14 UTC (rev 2795)
+++ pkg/vegan/R/anovacca.R 2013-12-03 16:02:58 UTC (rev 2796)
@@ -79,7 +79,7 @@
Pval <- c(Pval, NA)
table <- data.frame(tst$df, tst$chi, Fval, Pval)
is.rda <- inherits(object, "rda")
- colnames(table) <- c("Df", ifelse(is.rda, "Var", "Chisq"),
+ colnames(table) <- c("Df", ifelse(is.rda, "Variance", "ChiSquare"),
"F", "Pr(>F)")
head <- paste0("Permutation test for ", tst$method, " under ",
tst$model, " model\n", howHead(control))
Modified: pkg/vegan/R/anovacca.byterm.R
===================================================================
--- pkg/vegan/R/anovacca.byterm.R 2013-12-03 15:39:14 UTC (rev 2795)
+++ pkg/vegan/R/anovacca.byterm.R 2013-12-03 16:02:58 UTC (rev 2796)
@@ -31,7 +31,9 @@
c(sol[-1,4], sol[ntrm+1,2]),
c(sol[-1,5], NA),
c(sol[-1,6], NA))
- colnames(out) <- c("Df", "Chisq", "F", "Pr(>F)")
+ isRDA <- inherits(object, "rda")
+ colnames(out) <- c("Df", ifelse(isRDA, "Variance", "ChiSquare"),
+ "F", "Pr(>F)")
rownames(out) <- c(trmlab, "Residual")
head <- paste0("Permutation test for ", object$method, " under ",
model, " model\n",
@@ -92,7 +94,9 @@
## Collect results to anova data.frame
out <- data.frame(c(Df, dfbig), c(Chisq, chibig),
c(Fstat, NA), c(Pval, NA))
- colnames(out) <- c("Df", "Chisq", "F", "Pr(>F)")
+ isRDA <- inherits(object, "rda")
+ colnames(out) <- c("Df", ifelse(isRDA, "Variance", "ChiSquare"),
+ "F", "Pr(>F)")
rownames(out) <- c(trmlab, "Residual")
head <- paste0("Permutation test for ", object$method, " under ",
mods[[1]]$model, " model\n",
@@ -153,7 +157,9 @@
out <- data.frame(c(Df, resdf), c(eig, object$CA$tot.chi),
c(Fstat, NA), c(Pvals,NA))
rownames(out) <- c(names(eig), "Residual")
- colnames(out) <- c("Df", "Chisq", "F", "Pr(>F)")
+ isRDA <- inherits(object, "rda")
+ colnames(out) <- c("Df", ifelse(isRDA, "Variance", "ChiSquare"),
+ "F", "Pr(>F)")
head <- paste0("Permutation test for ", object$method, " under ",
model, " model\n",
"Marginal tests for axes\n",
More information about the Vegan-commits
mailing list