orditorp.Rd
The function adds text
or points
to
ordination plots. Text will be used if this can be done without
overwriting other text labels, and points will be used otherwise. The
function can help in reducing clutter in ordination graphics, but
manual editing may still be necessary.
A result object from ordination or an ordiplot
result. If the function is used in ordiplot
pipe, this
should be missing and first argument be display
.
Items to be displayed in the plot. Only one
alternative is allowed. Typically this is "sites"
or
"species"
.
Optional text used for labels. Row names of scores will
be used if this is missing. If select
is used, labels are
given only selected items in the order they occur in the scores.
Axes shown.
Text will be used for items with higher priority if labels overlap. This should be vector of the same length as the number of items plotted or number of scores.
Items to be displayed. This can either be a logical
vector which is TRUE
for displayed items or a vector of
indices, or labels
and if these are missing, row names of
scores. If a logical vector is used, it must have the same length as
the scores plotted.
Text and point sizes, see plot.default
..
Text and point colours, see plot.default
.
Plotting character, see points
.
Amount of empty space between text labels. Values <1 allow overlapping text.
Other arguments to scores
(and its various
methods), text
and points
.
Function orditorp
will add either text or points to an existing
plot. The items with high priority
will be added first
and text
will be used if this can be done without
overwriting previous labels,and points
will be used
otherwise. If priority
is missing, labels will be added from the
outskirts to the centre. Function orditorp
can be used
with most ordination results, or plotting results from
ordiplot
or ordination plot functions
(plot.cca
, plot.decorana
,
plot.metaMDS
). Function can also be used in a pipe
(|>
) where the first command is a vegan ordination
plot
command or ordiplot
.
Arguments can be passed to the relevant scores
method
for the ordination object (x
) being drawn. See the relevant
scores
help page for arguments that can be used.
The function returns invisibly the The function returns invisibly a
logical vector where TRUE
means that item was labelled with
text and FALSE
means that it was marked with a point. If
function is used in an ordiplot
pipe, it will return the
input ordiplot
object, but amend the plotted scores with this
vector as attribute "orditorp"
. The returned vector can be used
as the select
argument in ordination text
and
points
functions.
## A cluttered ordination plot :
data(BCI)
mod <- cca(BCI)
plot(mod, dis="sp", type="t")
# Now with orditorp and abbreviated species names
cnam <- make.cepnames(names(BCI))
plot(mod, dis="sp", type="n")
stems <- colSums(BCI)
orditorp(mod, "sp", labels = cnam, priority=stems, pch="+", pcol="grey")
## show select in action
set.seed(1)
take <- sample(ncol(BCI), 50)
plot(mod, dis="sp", type="n")
stems <- colSums(BCI)
## only selected items are labelled, and the labels must be in the some
## order as in the scores
orditorp(mod, "sp", labels = cnam[sort(take)], priority=stems, select = take,
pch="+", pcol="grey")
#> Warning: object '.Random.seed' not found