| to_spatial | R Documentation |
Convert a site-by-variable matrix into a SpatRaster or sf object
to_spatial(m, template)
m |
Matrix or vector with the same number of rows as sites in |
template |
|
SpatRaster with a layer for every column in m, or sf data frame with
a variable for every column in m, depending on the data type of template.
ps <- moss()
# ps$comm contains only occupied sites, so expand before converting:
to_spatial(ps_expand(ps, ps$comm[, 1:5]), ps$spatial)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.