axis_plot: Lollipop chart of species contributions to ordination axes...

View source: R/axis_plot.R

axis_plotR Documentation

Lollipop chart of species contributions to ordination axes (ggplot2)

Description

Creates a lollipop chart of species contributions to ordination axes with scalable point size

Usage

axis_plot(
  mod,
  axis = 1,
  sides = "both",
  n = 10,
  species = NULL,
  size_preset = "device",
  point_cols = c("#f8766d", "#00ba38"),
  xlab = NULL,
  ylab = NULL,
  sp_names = NULL,
  italicize_sp_names = FALSE,
  point_size = NULL,
  text_col = "white",
  map_size = FALSE,
  break_interval = NULL
)

Arguments

mod

cca or rda object

axis

The ordination axis for which the chart should be made for

sides

Character vector specifying which columns should be shown. Options: "both" shows n/2 from both sides of the axis ordered by species scores; "contrib" orders the species based on "contributions" to the axis (squared species scores); pos orders the species based on the species score to the axis and "neg" orders the species based on the inverted species score to the axis.

n

Number of columns (=species) to show

species

A character vector of species entries to be forced to the plot. The remaining of species will be taken from sides and n arguments.

size_preset

Character. Define the size preset of the plot. Options: "device", which is optimized for the R graph window, and "pdf", which is optimized as subplots to go together with ggord_plot.

point_cols

a character vector of length 2 specifying the colors for negative and positive species scores respectively.

xlab

X-axis label

ylab

Y-axis label. If NULL, the label is generated automatically from the cca or rda object.

sp_names

Optional data frame specifying the species names to be used in the plot. The first column has to specify the species names used in the cca or rda object and the second column the species names that should be used to replace the original names.

italicize_sp_names

Logical. Should species names be italicized?

point_size

Single number specifying the size for "lollipop heads".

text_col

Character. Color of text for the points. The text spcifies species contributions to the axis in percentages.

map_size

Logical. Should point size be mapped to species contributions to the axis?

break_interval

Single number specifying the interval to be used for x-axis.

Author(s)

Mikko Vihtakari

Examples

library(vegan)
data(dune)
axis_plot(rda(dune), break_interval = 0.5)

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