Learn R Programming

ggvegan (version 0.2.1)

autoplot.rda: ggplot-based plot for objects of class 'rda'

Description

Produces a multi-layer ggplot object representing the output of objects produced by vegan::rda().

Usage

# S3 method for rda
autoplot(
  object,
  axes = c(1, 2),
  geom = c("point", "text"),
  layers = c("species", "sites", "biplot", "centroids"),
  arrows = TRUE,
  legend.position = "none",
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  ylab = NULL,
  xlab = NULL,
  const = NULL,
  arrow.col = "navy",
  ...
)

Value

Returns a ggplot object.

Arguments

object

an object of class "rda", the result of a call to vegan::rda()

axes

numeric; which axes to plot, given as a vector of length 2.

geom

character; which geom to use for the species (variables) and sites (samples) layers. A vector of length 2; if a vector of length 1, geom is extended to the required length.

layers

character; which scores to plot as layers

arrows

logical; represent species (variables) using vectors?

legend.position

character or two-element numeric vector; where to position the legend. See ggplot2::theme() for details. Use "none" to not draw the legend.

title

character; subtitle for the plot.

subtitle

character; subtitle for the plot.

caption

character; caption for the plot.

ylab

character; label for the y-axis.

xlab

character; label for the x-axis.

const

General scaling constant to rda scores. See vegan::scores.rda() for details.

arrow.col

colour specification for biplot arrows and their labels.

...

Additional arguments passed to the fortify() method.

Author

Gavin L. Simpson

Details

TODO

Examples

Run this code

library("vegan")

data(dune)

pca <- rda(dune)
autoplot(pca)

## Just the species scores
autoplot(pca, layers = "species")

Run the code above in your browser using DataLab