ggord_plot: Alternative ordination plot for CCA and RDA objects (ggplot2)

View source: R/ggord_plot.R

ggord_plotR Documentation

Alternative ordination plot for CCA and RDA objects (ggplot2)

Description

Alternative to plot vegan's CCA and RDA objects using ggplot2. Produces illustrative and good looking graphics with less code and need for customization. Plots envfit and ordisurf when needed.

Usage

ggord_plot(
  mod,
  env_data = NULL,
  axes = 1:2,
  size_preset = "device",
  arrow.mul = NULL,
  ordisurf_var = NULL,
  centroids = TRUE,
  envfits = NULL,
  sp_repel_method = "orditorp",
  sp_label_omit = 0.1,
  capitalize_cn = TRUE,
  site_col = "grey70",
  sp_col = "firebrick3",
  sp_cross_col = "red",
  sp_arrow = FALSE,
  cn_col = "darkolivegreen",
  ordi_col = "lightskyblue1",
  envfits_col = c("#82C893", "#D696C8", "#056A89", "#B5794C", "#FF9252"),
  base_size = NULL,
  site_size = NULL,
  sp_size = NULL,
  cn_size = NULL,
  ordi_size = NULL,
  envfits_size = NULL,
  main = NULL
)

Arguments

mod

cca or rda object from vegan.

env_data

optional data frame containing environmental data, which should be fitted using the envfit and/or ordisurf functions. The data frame must have the same row order and number than the species data frame used to construct mod.

axes

numeric vector defining two ordination axes for the plot.

size_preset

character specifying the size preset for the graphic device. Options: "device" or "pdf". Size of symbols in the plot will be automatically scaled to the device or 122 mm wide pdf (page width for many scientific journals), respectively. You can override the scaling using the *_size arguments.

arrow.mul

factor to expand arrows in the graph. Analogous to the plot.cca argument of similar name.

ordisurf_var

character specifying the column name in env_data that should be used to plot ordisurf. If NULL, no ordisurf will be plotted.

centroids

logical indicating whether CCA or RDA centroids should be plotted (display = "cn" in plot.cca).

envfits

character vector specifying the names of envfit objects, which should be plotted.

sp_repel_method

character specifying desired the method to avoid cluttering of species names. Options: "orditorp", "label_omit", "ggrepel" or NULL. "orditorp" uses the approach from orditorp to select most contributing species labels, "label_omit" uses the sp_label_omit argument to omit species names, "ggrepel" uses the geom_text_repel function together with the sp_label_omit argument and NULL does not omit any species names. All omited species names are illustrated using + symbols.

sp_label_omit

numeric value giving the boundary for omiting species names. Any species labels less than this argument on either axis will be replaced by + symbols. Use sp_repel_method to disable the omiting.

capitalize_cn

logical indicating whether centroid names should be capitalized.

site_col

character specifying the color for sites (display = "sites" in plot.cca).

sp_col

character specifying the color for species (display = "species" in plot.cca).

sp_cross_col

character specifying the color for omited species label symbols (+).

sp_arrow

logical indicating whether biplot arrows should be plotted for species.

cn_col

character specifying the color for centroids (display = "cn" in plot.cca).

ordi_col

character specifying the color for ordisurf.

envfits_col

character vector specifying the colors for envfit objects.

base_size

base font size for ggplot2 (see theme_bw).

site_size

size parameter for site symbols

sp_size

font size for species labels

cn_size

font size for centroid labels

ordi_size

cex parameter for ordisurf.

envfits_size

cex parameter for envfit objects.

main

character giving the title for the plot. See ggtitle

Details

All font sizes should be specified using actual font sizes (not ggplot font sizes).

Author(s)

Mikko Vihtakari with code from Jari Oksanen


MikkoVihtakari/veganUtils documentation built on May 3, 2023, 9:58 a.m.