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, ...) ## S3 method for class 'cca': text(x, display = "sites", choices = c(1, 2), scaling = 2, mul.arrow = 1, head.arrow = 0.05, ...) ## S3 method for class 'cca': points(x, display = "sites", choices = c(1, 2), scaling = 2, mul.arrow = 1, head.arrow = 0.05, ...) ## S3 method for class 'cca': scores(x, choices=c(1,2), display=c("sp","wa","cn"),scaling=2, ...)
x |
A cca result object. |
choices |
Axes shown. |
display |
Scores shown. These must some of the alternatives
sp for species scores, 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. |
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. |
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. |
mul.arrow |
Factor to expand arrows to fit the graph. |
head.arrow |
Default length of arrow heads. |
... |
Other parameters for plotting 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 thus 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 with points.cca
and text.cca
the user must give the expansion factor in
mul.arrow
. The behaviour is still more peculiar with
display="cn"
which requests centroids of levels of
factor
variables (these are available only if there were
factors and a formula interface was used in cca
or
rda
). With this option, biplot arrows are plotted in
addition to centroids in cases which do not have a centroid: Continuous
variables are presented with arrows and ordered factors with 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
.
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.
Option display="cn"
(centroids and biplot arrows) may
become the default instead of the current display="bp"
in the
future version.
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", mul=2) points(mod, pch=21, col="red", bg="yellow", cex=1.2) text(mod, "species", col="blue", cex=0.8)