Learn R Programming

ggordiplots (version 0.4.3)

scale_arrow: Scale Arrows to Plot

Description

Scales envfit arrows to fit within 75

Usage

scale_arrow(arrows, data, at = c(0, 0), fill = 0.75)

Value

Silently returns a data frame of scaled coordinates for adding arrows to ordination plot.

Arguments

arrows

A two column data frame of coordinates from envfit result.

data

A two column data frame of coordinates for ordination plot.

at

coordinates of origin (0, 0)

fill

proportion of plot area to fill with maximum arrow length

Author

Jari Oksanen with modifications by Gavin Simpson and John Quensen

Examples

Run this code
data("varespec")
data("varechem")
vare_dist <- vegdist(varespec)
vare_mds <- monoMDS(vare_dist)
plt1 <- gg_envfit(ord=vare_mds, env=varechem, plot = FALSE)
mult <- scale_arrow(plt1$df_arrows, plt1$df_ord[ , c("x", "y")])
mult

Run the code above in your browser using DataLab