ordi_identify: Interactive identify

View source: R/bio2020.R

ordi_identifyR Documentation

Interactive identify

Description

Interactive identify ggvegan species

Usage

ordi_identify(plotname, size = 3, ...)

Arguments

plotname

Name of a plot created with ordi_plot

size

Font size of labels (default = 3)

...

Other optional parameters

Details

This function is designed to be run interactively. First create a standard ordination using ordi_pca, ordi_rda, ordi_ca, ordi_cca or ordi_nmds. Then call ordi_plot but make sure that the plot results is stored in an R object. Then apply this function to that object, and hit the Esc key to exit function. Note: In RStudio only the most recently displayed plot can be labelled with this function, so avoid using the back arrow keys in the RStudio plot window. Labelling may not always occur on first click, and is more difficult on constrained ordination plots.

Value

The original ordiname is modified with labels

Author(s)

Roy Sanderson, School of Natural & Environmental Science, Newcastle University roy.sanderson@newcastle.ac.uk

Examples

if(interactive()){

# Unconstrained ordination
data(dune)
data(dune.env)
dune_pca <- ordi_pca(dune)
dune_plt <- ordi_plot(dune_pca, layers="species", geom="point") # defaults to sites and species
dune_plt  # Display the plot
ordi_identify(dune_plt) # Hit Esc key to exit

# Constrained ordination
dune_rda <- ordi_rda(dune ~ A1 + Management, data=dune.env)
# displays spp and constraints.
# Constraints are "biplot" for continuous and "centroids" for categorical
dune_plt <- ordi_plot(dune_rda, layers=c("species", "biplot", "centroids"), geom="point")
dune_plt  # Display the plot
ordi_identify(dune_plt) # Hit Esc key to exit

}

rasanderson/bio2020 documentation built on Sept. 18, 2022, 11:40 a.m.