Learn R Programming

ggordiplots (version 0.4.3)

gg_envfit: Vegan envfit plot

Description

Fits environmental parameters to an ordination plot of sites and plots them as arrows.

Usage

gg_envfit(
  ord,
  env,
  groups = NA,
  scaling = 1,
  choices = c(1, 2),
  perm = 999,
  alpha = 0.05,
  angle = 20,
  len = 0.5,
  unit = "cm",
  arrow.col = "red",
  pt.size = 3,
  plot = TRUE
)

Value

Silently returns the plot and data frames used for the plotting if the fit of any variable is significant at alpha. Otherwise returns a message that no variable is significant.

Arguments

ord

An ordination object.

env

A data frame of environmental parameters.

groups

A vector of groups.

scaling

Scaling value for plot.

choices

Axes to plot.

perm

Number of permutations.

alpha

Maximum alpha value to be included in plot.

angle

Angle of arrow tips.

len

Arrow tip length.

unit

Unit for length ("cm", "in")

arrow.col

Arrow color.

pt.size

Symbol size.

plot

A logical for plotting; defaults to TRUE.

Examples

Run this code
data("varespec")
data("varechem")
vare.dist <- vegdist(varespec)
vare.mds <- monoMDS(vare.dist)
gg_envfit(ord=vare.mds, env=varechem)

data("dune")
data("dune.env")
dune.dist <- vegdist(dune)
dune.mds <- monoMDS(dune.dist)
# A1 supplied as a vector
gg_envfit(dune.mds, env=dune.env$A1, groups=dune.env$Management)
# A1 supplied as a data frame
A1 <- as.data.frame(dune.env$A1)
colnames(A1) <- "A1"
gg_envfit(dune.mds, env=A1, groups=dune.env$Management)

Run the code above in your browser using DataLab