Add Points and their Replled Labels to an ordiggplot Graph
Source:R/ordiggplot.R
geom_ordi_repel.RdFunction adds points to the exact position of the ordination score with a label, but labels are repelled from each other to avoid over-plotting. In very congested areas, the labels are completely omitted.
Arguments
- score
Ordination score added to the plot.
- data
Alternative data to the function that will be used instead of
score. This function does not handlevegan::envfit()results.- box
Draw a non-transparent box behind the text (logical).
- points
Draw points (logical).
- point.params, text.params
Parameters to modify points or their repelled text labels.
- ...
other arguments passed to
ggrepel::geom_text_repel()andggrepel::geom_label_repel().
Value
Returns ggrepel layers geom_text_repel or
geom_label_repel and ggplot2 layer geom_point (optionally).
Examples
library(vegan)
data(mite, mite.env, package = "vegan")
mod <- cca(mite)
ordiggplot(mod) +
geom_ordi_axis() +
geom_ordi_point("sites") +
geom_ordi_repel("species",
text.params = list(size=3, fontface = "italic"))