map_clusters: Create a map of bioregions

View source: R/map_clusters.R

map_clustersR Documentation

Create a map of bioregions

Description

This plot function can be used to visualise bioregions based on a bioRgeo.clusters object combined with a geometry (sf objects).

Usage

map_clusters(clusters, geometry, write_clusters = FALSE, plot = TRUE)

Arguments

clusters

an object of class bioRgeo.clusters or a data.frame. If a data.frame is used, the first column should represent the sites' ID, and the next column(s) the clusters.

geometry

a spatial object that can be handled by the sf package. The first attribute should correspond to the sites' ID (see Details).

write_clusters

a boolean indicating if the clusters should be added in geometry.

plot

a boolean indicating if the plot should be drawn.

Details

The clusters and geometry site IDs should correspond. They should have the same type (i.e. character is cluster is a bioRgeo.clusters object) and the site of clusters should be included in the sites of geometry.

Value

One or several maps of bioregions if plot = TRUE and the geometry with additional clusters' attributes if write_clusters = TRUE.

Author(s)

Maxime Lenormand (maxime.lenormand@inrae.fr), Boris Leroy (leroy.boris@gmail.com) and Pierre Denelle (pierre.denelle@gmail.com)

Examples

## Not run: 
data(fishmat)
data(fishsp)

net <- similarity(fishmat, metric = "Simpson")
clu <- netclu_greedy(net)
map <- map_clusters(clu, fishsf, write_clusters = TRUE, plot = FALSE)

## End(Not run)


bioRgeo/bioRgeo documentation built on March 10, 2023, 9:48 p.m.