[Vegan-commits] r801 - in pkg/vegan: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Apr 14 11:59:59 CEST 2009
Author: jarioksa
Date: 2009-04-14 11:59:59 +0200 (Tue, 14 Apr 2009)
New Revision: 801
Modified:
pkg/vegan/R/ordisurf.R
pkg/vegan/inst/ChangeLog
pkg/vegan/man/ordisurf.Rd
Log:
ordisurf fits a quadratic trend surfaces with 'knots = 2', linear with 'knots = 1' or '0'
Modified: pkg/vegan/R/ordisurf.R
===================================================================
--- pkg/vegan/R/ordisurf.R 2009-04-08 12:36:27 UTC (rev 800)
+++ pkg/vegan/R/ordisurf.R 2009-04-14 09:59:59 UTC (rev 801)
@@ -16,6 +16,12 @@
x2 <- X[, 2]
if (knots <= 0)
mod <- gam(y ~ x1 + x2, family = family, weights = w)
+ else if (knots == 1)
+ mod <- gam(y ~ poly(x1, 1) + poly(x2, 1),
+ family = family, weights = w)
+ else if (knots == 2)
+ mod <- gam(y ~ poly(x1, 2) + poly(x2, 2) + poly(x1, 1):poly(x2, 1),
+ family = family, weights = w)
else if (thinplate)
mod <- gam(y ~ s(x1, x2, k = knots), family = family,
weights = w)
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2009-04-08 12:36:27 UTC (rev 800)
+++ pkg/vegan/inst/ChangeLog 2009-04-14 09:59:59 UTC (rev 801)
@@ -15,7 +15,7 @@
dissimilarities. Its summary function returns the overall averages
of those distances, and all three variants of MRPP A statistic,
and classification strength. The plot method draws a dendrogram
- based on the mean dissimilarity matrix, with leafs hanging to
+ based on the mean dissimilarity matrix, with leaves hanging to
within-group dissimilarity.
* betadisper: Fix bug corrects the way distance to centroid is
@@ -33,7 +33,10 @@
because metaMDSdist/vegdist were passing 'trymax' to decostand()
while evaluating "gower" dissimilarity.
- * ordisurf: will fit a linear trend surface if knots = 0.
+ * ordisurf: will fit a linear trend surface if knots = 0 or knots
+ = 1, and a quadratic trend surface if knots = 2. All these are
+ below the lowest permissible values of 'gam' smoothers and free
+ for creative reuse.
Version 1.16-16 (closed April 2, 2009)
Modified: pkg/vegan/man/ordisurf.Rd
===================================================================
--- pkg/vegan/man/ordisurf.Rd 2009-04-08 12:36:27 UTC (rev 800)
+++ pkg/vegan/man/ordisurf.Rd 2009-04-14 09:59:59 UTC (rev 801)
@@ -19,8 +19,10 @@
\item{y}{ Variable to be plotted. }
\item{choices}{Ordination axes. }
\item{knots}{Number of initial knots in \code{\link[mgcv]{gam}} (one
- more than degrees of freedom). If \code{knots = 0}, the function
- will fit a linear trend surface instead of a smooth surface. }
+ more than degrees of freedom). If \code{knots = 0} or
+ \code{knots = 1} the function will fit a linear trend surface, and
+ if \code{knots = 2} the function will fit a quadratic trend surface
+ instead of a smooth surface. }
\item{family}{ Error distribution in \code{\link[mgcv]{gam}}. }
\item{col}{ Colour of contours. }
\item{thinplate}{Use thinplate splines in \code{\link[mgcv]{gam}}.}
More information about the Vegan-commits
mailing list