View source: R/lets_envcells.R
| lets.plot.envcells | R Documentation |
Plots each column of the descriptor table returned by
lets.envcells back onto the environmental richness raster
embedded in the environmental space PAM object.
lets.plot.envcells(
x,
y,
ras = FALSE,
plot_ras = TRUE,
mfrow = c(4, 4),
which.plot = NULL,
col_func = NULL,
xlab = NULL,
ylab = NULL,
...
)
x |
The envPAM list returned by |
y |
A |
ras |
Logical; if |
plot_ras |
Logical; if |
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. |
which.plot |
Indicate the number of the columns in y to be plotted. |
col_func |
A custom color ramp palette function to use for plotting variables (e.g., from |
xlab |
Character string specifying the label for the x-axis. |
ylab |
Character string specifying the label for the y-axis. |
... |
other arguments passed to |
Plot environmental descriptors over the environmental raster grid
Each descriptor column is assigned as values of the environmental raster
template and plotted sequentially. Rows with zero frequency are masked as
NA. The plotting grid defaults to par(mfrow = c(4,4)).
If ras = TRUE, returns a named list of SpatRaster
objects corresponding to each descriptor column.
## Not run: B
data("Phyllomedusa"); data("prec"); data("temp")
prec <- unwrap(prec); temp <- unwrap(temp)
PAM <- lets.presab(Phyllomedusa, remove.cells = FALSE)
envs <- lets.addvar(PAM, c(temp, prec), onlyvar = TRUE)
colnames(envs) <- c("Temperature", "Precipitation")
wrld_simpl <- get(utils::data("wrld_simpl", package = "letsR"))
PAM <- lets.pamcrop(PAM, terra::vect(wrld_simpl))
res <- lets.envpam(PAM, envs, n_bins = 30)
out <- lets.envcells(res, perc = 0.2)
lets.plot.envcells(res, out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.