[Vegan-commits] r1603 - in pkg/vegan: R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue May 17 13:00:04 CEST 2011
Author: jarioksa
Date: 2011-05-17 13:00:03 +0200 (Tue, 17 May 2011)
New Revision: 1603
Modified:
pkg/vegan/R/add1.cca.R
pkg/vegan/R/anova.ccabyaxis.R
pkg/vegan/R/anova.ccabymargin.R
pkg/vegan/R/drop1.cca.R
pkg/vegan/R/model.frame.cca.R
pkg/vegan/R/model.matrix.cca.R
pkg/vegan/inst/ChangeLog
Log:
many cca/rda support functions fail with prc results
Modified: pkg/vegan/R/add1.cca.R
===================================================================
--- pkg/vegan/R/add1.cca.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/add1.cca.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -2,6 +2,8 @@
function(object, scope, test = c("none", "permutation"),
pstep = 100, perm.max = 200, ...)
{
+ if (inherits(object, "prc"))
+ stop("'step'/'add1' cannot be used for 'prc' objects")
test <- match.arg(test)
## Default add1
out <- NextMethod("add1", object, test = "none", ...)
Modified: pkg/vegan/R/anova.ccabyaxis.R
===================================================================
--- pkg/vegan/R/anova.ccabyaxis.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/anova.ccabyaxis.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -1,6 +1,8 @@
-"anova.ccabyaxis" <-
-function (object, cutoff = 1, ...)
+`anova.ccabyaxis` <-
+ function (object, cutoff = 1, ...)
{
+ if(inherits(object, "prc"))
+ stop("anova(..., by = 'axis') cannot be used for 'prc' results")
cutoff <- cutoff + sqrt(.Machine$double.eps)
rnk <- object$CCA$rank
if (!max(rnk, 0))
Modified: pkg/vegan/R/anova.ccabymargin.R
===================================================================
--- pkg/vegan/R/anova.ccabymargin.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/anova.ccabymargin.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -1,6 +1,8 @@
`anova.ccabymargin` <-
function(object, step=100, scope, ...)
{
+ if(inherits(object, "prc"))
+ stop("anova(..., by = 'margin') cannot be used for 'prc' results")
if (!missing(scope) && is.character(scope))
trms <- scope
else
Modified: pkg/vegan/R/drop1.cca.R
===================================================================
--- pkg/vegan/R/drop1.cca.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/drop1.cca.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -2,6 +2,8 @@
function(object, scope, test = c("none", "permutation"),
pstep = 100, perm.max = 200, ...)
{
+ if (inherits(object, "prc"))
+ stop("'step'/'drop1' cannot be used for 'prc' objects")
test <- match.arg(test)
out <- NextMethod("drop1", object, test="none", ...)
cl <- class(out)
Modified: pkg/vegan/R/model.frame.cca.R
===================================================================
--- pkg/vegan/R/model.frame.cca.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/model.frame.cca.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -1,6 +1,8 @@
`model.frame.cca` <-
function (formula, ...)
{
+ if (inherits(formula, "prc"))
+ stop("model.frame does not work with 'prc' results")
call <- formula$call
m <- match(c("formula", "data", "na.action", "subset"), names(call),
0)
Modified: pkg/vegan/R/model.matrix.cca.R
===================================================================
--- pkg/vegan/R/model.matrix.cca.R 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/R/model.matrix.cca.R 2011-05-17 11:00:03 UTC (rev 1603)
@@ -1,6 +1,8 @@
`model.matrix.cca` <-
function (object, ...)
{
+ if (inherits(object, "prc"))
+ stop("model.matrix does not work with 'prc' results")
call <- object$call
m <- match(c("formula", "data", "na.action", "subset"), names(call),
0)
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2011-05-16 20:05:40 UTC (rev 1602)
+++ pkg/vegan/inst/ChangeLog 2011-05-17 11:00:03 UTC (rev 1603)
@@ -16,6 +16,13 @@
* scores.cca/rda: failed if user requested only non-existing
scores. Now return an empty list of scores instead (with possible
attributes).
+
+ * prc: several support methods did not work with 'prc' results,
+ and these now stop with an informative error instead of an
+ uniformative error. Concerns anova.ccabymargin, anova.ccabyaxis,
+ drop1.cca, add1.cca, model.frame.cca, model.matrix.cca. This was
+ found out after a private user query about having signficance test
+ for the sencond PRC axis.
Version 1.18-29 (closed April 27, 2011)
More information about the Vegan-commits
mailing list