Skip to contents

This function calculates the number of sites per bioregion, as well as the the number of species these sites have, the number of endemic species and the proportion of endemism.

Usage

bioregion_metrics(cluster_object, comat, map = NULL, col_bioregion = NULL)

Arguments

cluster_object

a bioregion.clusters object or a data.frame or a list of data.frame containing multiple partitions. At least two partitions are required. If a list of data.frame is provided, they should all have the same number of rows (i.e., same items in the clustering for all partitions).

comat

a co-occurrence matrix with sites as rows and species as columns.

map

a spatial sf data.frame with sites and bioregions. It is the output of the function map_bioregions. NULL by default.

col_bioregion

an integer specifying the column position of the bioregion.

Value

A data.frame with 5 columns, or 6 if the spatial coherence is computed.

Details

Endemic species are species only found in the sites belonging to one bioregion.

Author

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

Examples

comat_1 <- matrix(sample(0:1000, size = 10*12, replace = TRUE,
prob = 1/1:1001), 10, 12)
rownames(comat_1) <- paste0("Site", 1:10)
colnames(comat_1) <- paste0("Species", 1:12)
comat_1 <- cbind(comat_1,
                 matrix(0, 10, 8,
                        dimnames = list(paste0("Site", 1:10),
                                        paste0("Species", 13:20))))

comat_2 <- matrix(sample(0:1000, size = 10*12, replace = TRUE,
                         prob = 1/1:1001), 10, 12)
rownames(comat_2) <- paste0("Site", 11:20)
colnames(comat_2) <- paste0("Species", 9:20)
comat_2 <- cbind(matrix(0, 10, 8,
                        dimnames = list(paste0("Site", 11:20),
                                        paste0("Species", 1:8))),
                 comat_2)

comat <- rbind(comat_1, comat_2)

dissim <- dissimilarity(comat, metric = "Simpson")
clust1 <- nhclu_kmeans(dissim, n_clust = 3, index = "Simpson")

net <- similarity(comat, metric = "Simpson")
com <- netclu_greedy(net)

bioregion_metrics(cluster_object = clust1, comat = comat) 
#>   Bioregion Site_number Species_number Endemics Percentage_Endemic
#> 1         2          10             12        8           66.66667
#> 2         1           8             12        0            0.00000
#> 3         3           2             11        0            0.00000

# Spatial coherence
vegedissim <- dissimilarity(vegemat)
hclu <- nhclu_kmeans(dissimilarity = vegedissim, n_clust = 4)
vegemap <- map_bioregions(hclu, vegesf, write_clusters = TRUE, plot = FALSE)

bioregion_metrics(cluster_object = hclu, comat = vegemat, map = vegemap,
col_bioregion = 2) 
#>   Bioregion Site_number Species_number Endemics Percentage_Endemic Coherence
#> 1         2         128           2527       90           3.561535  49.21875
#> 2         4         169           2983       45           1.508548  56.21302
#> 3         3         298           2936       56           1.907357  98.99329
#> 4         1         120           2262       67           2.961981  79.16667