gg_ordiplot: Plot with Ellipses, Hulls, Spiders

View source: R/gg_ordiplot.R

gg_ordiplotR Documentation

Plot with Ellipses, Hulls, Spiders

Description

gg_ordiplot uses ggplot2 to make an ordination plot with group ellipses by default, and optionally hulls and/or spiders. It is patterned after vegan's functions ordiellipse, ordihull, and ordispider and accepts similar parameters.

Usage

gg_ordiplot(
  ord,
  groups,
  scaling = 1,
  choices = c(1, 2),
  kind = c("sd", "se", "ehull"),
  conf = NULL,
  show.groups = "all",
  ellipse = TRUE,
  label = FALSE,
  hull = FALSE,
  spiders = FALSE,
  pt.size = 3,
  plot = TRUE
)

Arguments

ord

An ordination object.

groups

A vector of groups.

scaling

Scaling for ordination plot.

choices

Axes to be plotted.

kind

Type of ellipses to show ("se", sd", "ehull").

conf

Confidence value for ellipses if "se" or "sd."

show.groups

Subset of groups to plot.

ellipse

A logical for plotting ellipses; defaults to TRUE.

label

A logical for labeling group centroids.

hull

A logical for plotting group hulls.

spiders

A logical for plotting group spiders.

pt.size

Symbol size.

plot

A logical for plotting; defaults to TRUE.

Value

Silently returns the plot and data frames used for the plotting.

Examples

data("dune")
data("dune.env")
dune.hel <- decostand(dune, method = "hellinger")
ord <- rda(dune.hel)
gg_ordiplot(ord, groups = dune.env$Management)


jfq3/ggordiplots documentation built on Feb. 3, 2024, 11:50 p.m.