ps_rgb {phylospatial} | R Documentation |
Map phylospatial data onto RGB color bands
Description
Perform an ordination that reduces a spatial phylogenetic data set into three dimensions that can be
plotted as the RGB bands of color space to visualize spatial patterns of community phylogenetic composition.
This function is a wrapper around ps_ordinate()
.
Usage
ps_rgb(ps, method = c("nmds", "cmds", "pca"), trans = identity, spatial = TRUE)
Arguments
ps |
A |
method |
Ordination method, either "pca" (principal component analysis implemented via |
trans |
A function giving a transformation to apply to each dimension of the ordinated data.
The default is the identity function. Specifying |
spatial |
Logical indicating whether a spatial object (inherited from |
Value
A matrix or spatial object with three variables containing RGB color values in the range 0-1.
Examples
ps <- ps_add_dissim(moss())
RGB <- ps_rgb(ps, method = "cmds")
terra::plotRGB(RGB * 255, smooth = FALSE)