[Vegan-commits] r1038 - in pkg/vegan: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Oct 7 19:55:56 CEST 2009
Author: jarioksa
Date: 2009-10-07 19:55:56 +0200 (Wed, 07 Oct 2009)
New Revision: 1038
Added:
pkg/vegan/R/model.frame.cca.R
pkg/vegan/R/model.matrix.cca.R
Modified:
pkg/vegan/inst/ChangeLog
pkg/vegan/man/cca.Rd
Log:
add model.frame.cca & model.matrix.cca
Added: pkg/vegan/R/model.frame.cca.R
===================================================================
--- pkg/vegan/R/model.frame.cca.R (rev 0)
+++ pkg/vegan/R/model.frame.cca.R 2009-10-07 17:55:56 UTC (rev 1038)
@@ -0,0 +1,15 @@
+`model.frame.cca` <-
+ function (formula, ...)
+{
+ call <- formula$call
+ m <- match(c("formula", "data", "na.action", "subset"), names(call),
+ 0)
+ call <- call[c(1, m)]
+ call[[1]] <- as.name("ordiParseFormula")
+ out <- eval(call, parent.frame())
+ mf <- out$modelframe
+ attr(mf, "terms") <- out$terms.expand
+ if (!is.null(out$na.action))
+ attr(mf, "na.action") <- out$na.action
+ mf
+}
Added: pkg/vegan/R/model.matrix.cca.R
===================================================================
--- pkg/vegan/R/model.matrix.cca.R (rev 0)
+++ pkg/vegan/R/model.matrix.cca.R 2009-10-07 17:55:56 UTC (rev 1038)
@@ -0,0 +1,18 @@
+`model.matrix.cca` <-
+ function (formula, ...)
+{
+ call <- formula$call
+ m <- match(c("formula", "data", "na.action", "subset"), names(call),
+ 0)
+ call <- call[c(1, m)]
+ call[[1]] <- as.name("ordiParseFormula")
+ out <- eval(call, parent.frame())[c("Z", "Y")]
+ m <- list()
+ if (!is.null(out$Z))
+ m$Conditions <- out$Z
+ if (!is.null(out$Y))
+ m$Constraints <- out$Y
+ if (length(m) == 1)
+ m <- m[[1]]
+ m
+}
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2009-10-07 08:25:51 UTC (rev 1037)
+++ pkg/vegan/inst/ChangeLog 2009-10-07 17:55:56 UTC (rev 1038)
@@ -4,6 +4,12 @@
Version 1.16-31 (opened October 3, 2009)
+ * model.frame.cca, model.matrix.cca: new support functions to
+ reconstitute the model frame and model matrix (or a list of
+ condition and constrain model matrices) from a cca/rda/capscale
+ result object. Not yet documentd (don't know where?), but alias is
+ in cca.Rd.
+
* constrained ordination (cca, rda, capscale) did not analyse
constrained component in model like cca(varespec ~ Al:P +
Condition(Al + P)) or in constrained interaction terms if the
Modified: pkg/vegan/man/cca.Rd
===================================================================
--- pkg/vegan/man/cca.Rd 2009-10-07 08:25:51 UTC (rev 1037)
+++ pkg/vegan/man/cca.Rd 2009-10-07 17:55:56 UTC (rev 1038)
@@ -6,6 +6,8 @@
\alias{rda}
\alias{rda.default}
\alias{rda.formula}
+\alias{model.frame.cca} % <- Move to a better help page!!
+\alias{model.matrix.cca} % <- Move to a better help page!
\concept{ordination}
\title{ [Partial] [Constrained] Correspondence Analysis and Redundancy
More information about the Vegan-commits
mailing list