plot.cca {vegan}  R Documentation 
Functions to plot or extract results of constrained correspondence analysis
(cca
), redundancy analysis (rda
) or
constrained analysis of principal coordinates (capscale
).
## S3 method for class 'cca': plot(x, choices = c(1, 2), display = c("sp", "wa", "cn"), scaling = 2, type, xlim, ylim, const, ...) ## S3 method for class 'cca': text(x, display = "sites", labels, choices = c(1, 2), scaling = 2, arrow.mul, head.arrow = 0.05, select, const, ...) ## S3 method for class 'cca': points(x, display = "sites", choices = c(1, 2), scaling = 2, arrow.mul, head.arrow = 0.05, select, const, ...) ## S3 method for class 'cca': scores(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, ...) ## S3 method for class 'rda': scores(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, const, ...) ## S3 method for class 'cca': summary(object, scaling = 2, axes = 6, display = c("sp", "wa", "lc", "bp", "cn"), digits = max(3, getOption("digits")  3), ...) ## S3 method for class 'summary.cca': print(x, digits = x$digits, head = NA, tail = head, ...) ## S3 method for class 'summary.cca': head(x, n = 6, tail = 0, ...) ## S3 method for class 'summary.cca': tail(x, n = 6, head = 0, ...)
x, object 
A cca result object. 
choices 
Axes shown. 
display 
Scores shown. These must some of the alternatives
species or sp for species scores, sites or
wa for site scores, lc for linear constraints or ``LC
scores'', or bp for biplot arrows or cn for centroids
of factor constraints instead of an arrow. 
scaling 
Scaling for species and site scores. Either species
(2 ) or site (1 ) scores are scaled by eigenvalues, and
the other set of scores is left unscaled, or with 3 both are
scaled symmetrically by square root of eigenvalues. Corresponding
negative values can be used in cca to additionally multiply
results with sqrt(1/(1λ)). This scaling is know as
Hill scaling (although it has nothing to do
with Hill's rescaling of decorana ). With corresponding
negative values inrda ,
species scores are divided by standard deviation of each species and
multiplied with an equalizing constant.
Unscaled raw scores stored in the result can be accessed with
scaling = 0 .

type 
Type of plot: partial match to text
for text labels, points for points, and none for
setting frames only. If omitted, text is selected for
smaller data sets, and points for larger. 
xlim, ylim 
the x and y limits (min,max) of the plot. 
labels 
Optional text to be used instead of row names. 
arrow.mul 
Factor to expand arrows in the graph. Arrows will be scaled automatically to fit the graph if this is missing. 
head.arrow 
Default length of arrow heads. 
select 
Items to be displayed. This can either be a logical
vector which is TRUE for displayed items or a vector of indices
of displayed items. 
const 
General scaling constant to rda scores. The
default is to use constant to give biplot scores, or scores that
approximate original data. 
axes 
Number of axes in summaries. 
digits 
Number of digits in output. 
n, head, tail 
Number of rows printed from the head and tail of
species and site scores. Default NA prints all. 
... 
Parameters passed to other functions. 
Same plot
function will be used for cca
and
rda
. This produces a quick, standard plot with current
scaling
.
The plot
function sets colours (col
), plotting
characters (pch
) and character sizes (cex
) to
certain standard values. For a fuller control of produced plot, it is
best to call plot
with type="none"
first, and then add
each plotting item separately using text.cca
or
points.cca
functions. These use the default settings of standard
text
and points
functions and accept all
their parameters, allowing a full user control of produced plots.
Environmental variables receive a special treatment. With
display="bp"
, arrows will be drawn. These are labelled with
text
and unlabelled with points
. The basic plot
function uses a simple (but not very clever) heuristics for adjusting
arrow lengths to plots, but the user can give the expansion factor in
mul.arrow
. With display="cn"
the centroids of levels of
factor
variables are displayed (these are available only if there were
factors and a formula interface was used in cca
or
rda
). With this option continuous
variables still are presented as arrows and ordered factors as arrows
and centroids.
If you want to have still a better control of plots, it is better to
produce them using primitive plot
commands. Function
scores
helps in extracting the
needed components with the selected scaling
.
Function summary
lists all scores and the output can be very
long. You can suppress scores by setting axes = 0
or
display = NA
or display = NULL
. You can display some
first or last (or both) rows of scores by using head
or
tail
or explicit print
command for the summary
.
Palmer (1993) suggested using linear constraints
(``LC scores'') in ordination diagrams, because these gave better
results in simulations and site scores (``WA scores'') are a step from
constrained to unconstrained analysis. However, McCune (1997) showed
that noisy environmental variables (and all environmental
measurements are noisy) destroy ``LC scores'' whereas ``WA scores''
were little affected. Therefore the plot
function uses site
scores (``WA scores'') as the default. This is consistent with the
usage in statistics and other functions in R
(lda
, cancor
).
The plot
function returns invisibly a plotting structure which
can be used by function identify.ordiplot
to identify
the points or other functions in the ordiplot
family.
Package ade4 has function cca
which
returns constrained correspondence analysis of the same class as the
vegan function. If you have results of ade4 in your
working environment, vegan functions may try to handle them and
fail with cryptic error messages. However, there is a simple utility
function ade2vegancca
which tries to translate ade4
cca
results to vegan cca
results so that some
vegan functions may work partially with ade4 objects
(with a warning).
Jari Oksanen
cca
, rda
and capscale
for getting something
to plot, ordiplot
for an alternative plotting routine
and more support functions, and text
,
points
and arrows
for the basic routines.
data(dune) data(dune.env) mod < cca(dune ~ A1 + Moisture + Management, dune.env) plot(mod, type="n") text(mod, dis="cn") points(mod, pch=21, col="red", bg="yellow", cex=1.2) text(mod, "species", col="blue", cex=0.8) ## Limited output of 'summary' head(summary(mod), tail=2)