View source: R/lets_attrcells.R
| lets.plot.attrcells | R Documentation |
Maps each descriptor column returned by lets.attrcells back
onto the attribute raster. Optionally returns the rasters without plotting.
lets.plot.attrcells(
x,
y,
ras = FALSE,
plot_ras = TRUE,
col_func = NULL,
mfrow = c(4, 4)
)
x |
A list returned by |
y |
A |
ras |
Logical; if |
plot_ras |
Logical; if |
col_func |
A custom color ramp palette function to use for plotting variables (e.g., from |
mfrow |
A vector of the form c(nr, nc). The figures will be drawn in an nr-by-nc array on the device by rows as in par documentation. |
Plot attribute-cell descriptors as rasters
Rows with zero or NA richness are masked before plotting, to avoid
edge artifacts from empty attribute cells. The plotting grid defaults to
par(mfrow = c(4, 4)); adjust as needed.
If ras = TRUE, returns a named list
of SpatRaster layers (one per descriptor column).
## Not run:
# Example with simulated traits
data(PAM)
n <- length(PAM$Species_name)
Species <- PAM$Species_name
trait_a <- rnorm(n)
trait_b <- trait_a * 0.2 + rnorm(n) # correlated trait
df <- data.frame(Species, trait_a, trait_b)
# Build AttrPAM
x <- lets.attrpam(df, n_bins = 4)
# Compute descriptors
desc <- lets.attrcells(x, PAM)
# Plot descriptors
lets.plot.attrcells(x, desc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.