View source: R/map_bioregions.R
| map_bioregions | R Documentation |
This plot function can be used to visualize bioregions based on a
bioregion.clusters object combined with a spatial object (sf or terra).
map_bioregions(
bioregionalization,
map,
partition_index = NULL,
map_as_output = FALSE,
plot = TRUE,
clusters = NULL,
geometry = NULL,
write_clusters = NULL,
...
)
bioregionalization |
A |
map |
A spatial object that can be handled by |
partition_index |
An |
map_as_output |
A |
plot |
A |
clusters |
Deprecated. Use |
geometry |
Deprecated. Use |
write_clusters |
Deprecated. Use |
... |
Further arguments to be passed to |
The site IDs in bioregionalization and map should correspond. They must
have the same type (i.e., character if bioregionalization is a
bioregion.clusters object), and the sites in bioregionalization should be
included among the sites in map. If map is an sf or a SpatVector
(terra) object, it should contain an attribute table with the IDs in the
first column. If map is a SpatRaster (terra) object, it should contain
the IDs in the first layer.
If the bioregionalization object contains both types of nodes (sites and
species), only site will be mapped. The function automatically filters to
site nodes using the node_type attribute.
Colors: If the bioregionalization object contains colors (added via
bioregion_colors()), these colors will be automatically used for plotting.
Otherwise, the default sf color scheme will be applied.
One or several maps of bioregions if plot = TRUE and the
sf data.frame object used for the plot if map_as_output = TRUE.
Maxime Lenormand (maxime.lenormand@inrae.fr)
Boris Leroy (leroy.boris@gmail.com)
Pierre Denelle (pierre.denelle@gmail.com)
For more details illustrated with a practical example, see the vignette: https://biorgeo.github.io/bioregion/articles/a5_1_visualization.html.
Associated functions: bioregion_colors
data(fishmat)
data(fishsf)
net <- similarity(fishmat, metric = "Simpson")
clu <- netclu_greedy(net)
mapclu <- map_bioregions(clu,
map = fishsf,
map_as_output = TRUE,
plot = FALSE)
# With colors
clu_colored <- bioregion_colors(clu)
mapclu <- map_bioregions(clu_colored,
map = fishsf,
map_as_output = TRUE,
plot = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.