Learn R Programming

ggvegan (version 0.2.1)

fortify.metaMDS: Fortify a "mataMDS" object.

Description

Fortifies an object of class "metaMDS" to produce a data frame of the selected axis scores in long format, suitable for plotting with ggplot2::ggplot().

Usage

# S3 method for metaMDS
fortify(model, data, axes = 1:2, layers = c("sites", "species"), ...)

# S3 method for metaMDS tidy(x, data, layers = c("sites", "species"), ...)

Value

A data frame in long format containing the ordination scores. The first two components are the axis scores.

Arguments

model, x

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

data

currently ignored.

axes

numeric; which axes to extract scores for.

layers

character; the scores to extract in the fortified object. Passed to display in the respective vegan::scores() method.

...

additional arguments passed to vegan::scores.metaMDS(). Note you can't use display.

Author

Gavin L. Simpson

Details

TODO

Examples

Run this code

library("vegan")

data(dune)

ord <- metaMDS(dune)
head(fortify(ord))

Run the code above in your browser using DataLab