ordisurf {vegan} | R Documentation |
Function ordisurf
fits a smooth surface for given variable and
plots the result on ordination diagram.
ordisurf(x, y, choices=c(1, 2), knots=10, family="gaussian", col="red", thinplate = TRUE, add = FALSE, display = "sites", w = weights(x), ...)
x |
Ordination configuration, either a matrix or a result known
by scores . |
y |
Variable to be plotted. |
choices |
Ordination axes. |
knots |
Number of initial knots in gam (one
more than degrees of freedom). |
family |
Error distribution in gam . |
col |
Colour of contours. |
thinplate |
Use thinplate splines in gam . |
add |
Add contours on an existing diagram or draw a new plot. |
display |
Type of scores known by scores : typically
"sites" for ordinary site scores or "lc" for linear combination scores. |
w |
Prior weights on the data. Concerns mainly cca
and decorana results which have nonconstant weights. |
... |
Other graphical parameters. |
Function ordisurf
fits a smooth surface using thinplate spline
fitting in gam
, and interpolates the fitted
values into a
regular grid using interp
. Finally, it plots the
results either over an existing ordination diagram or draws a new plot
with sample plots and fitted contours. The function uses
scores
to extract ordination scores, and x
can be
any result object known by that function.
User can supply a vector of prior weights w
. If the ordination
object has weights, these will be used. In practise this means that
the row totals are used as weights with
cca
or
decorana
results. This means that sites with lower
totals will
have lower weights. If you do not like this, but want to give
equal weights to all sites, you should set w = NULL
. The
behaviour is consistent with envfit
. For complete
accordance with constrained cca
, you should set
display = "lc"
(and possibly scaling = 2
).
Function is usually called for its side effect of drawing the contour
plot, but it returns the result object of gam
.
The function requires libraries mgcv
(gam
) and akima
(interp
). In fact, it is a very primitive wrapper
for these.
The default is to use thinplate splines. These make sense in ordination as they have equal smoothing in all directions and are rotation invariant. However, they seem to fail badly in some case, and then separate spline smoothing may be used.
Dave Roberts and Jari Oksanen
For basic routines gam
,
interp
and scores
. Function
envfit
provides a poorer but more traditional and compact
alternative.
## The examples are not run by `example(ordisurf)' because they need ## libraries `mgcv' and `akima' which may not exist in every system. ## Not run: data(varespec) data(varechem) library(MASS) vare.dist <- vegdist(varespec) vare.mds <- isoMDS(vare.dist) attach(varespec) attach(varechem) ordisurf(vare.mds, Baresoil, xlab="Dim1", ylab="Dim2") ## Total cover of reindeer lichens ordisurf(vare.mds, Cla.ste+Cla.arb+Cla.ran, xlab="Dim1", ylab="Dim2") ## End(Not run)