Learn R Programming

phyloregion (version 1.0.8)

plot.phyloregion: Visualize biogeographic patterns

Description

Visualize biogeographic patterns

Usage

# S3 method for phyloregion
plot(x, pol = NULL, palette = "NMDS", col = NULL, label = FALSE, ...)

plot_NMDS(x, ...)

text_NMDS(x, ...)

Value

No return value, called for plotting.

Arguments

x

an object of class phyloregion from phyloregion

pol

a polygon shapefile of grid cells.

palette

name of the palette to generate colors from. The default, “NMDS”, allows display of phyloregions in multidimensional scaling color space matching the color vision of the human visual system. The name is matched to the list of available color palettes from the hcl.colors function in the grDevices package.

col

vector of colors of length equal to the number of phyloregions.

label

Logical, whether to print cluster names or not

...

arguments passed among methods.

Examples

Run this code
library(terra)
data(africa)
tree <- africa$phylo
x <- africa$comm
p <- vect(system.file("ex/sa.json", package = "phyloregion"))

subphy <- match_phylo_comm(tree, x)$phy
submat <- match_phylo_comm(tree, x)$com

pbc <- phylobeta(submat, subphy)
y <- phyloregion(pbc[[1]], pol=p)

plot_NMDS(y, cex=6)
text_NMDS(y, cex=2)
plot(y, cex=1, palette="NMDS")
plot(y, cex=1)

Run the code above in your browser using DataLab