ps_regions | R Documentation |
Perform a clustering analysis that categorizes sites into biogeographic regions based on phylogenetic community compositional similarity.
ps_regions(ps, k = 5, method = "average", endemism = FALSE, normalize = TRUE)
ps |
A |
k |
Number of spatial clusters to divide the region into (positive integer). See ps_regions_eval to help choose a value of k by comparing the variance explained by different numbers of regions. |
method |
Clustering method. Options include all methods listed under hclust, and |
endemism |
Logical indicating whether community values should be divided by column totals (taxon range sizes)
to derive endemism. Only used if |
normalize |
Logical indicating whether community values should be divided by row totals (community sums). If |
A raster or matrix with an integer indicating which of the k
regions each site belongs to.
Daru, B. H., Elliott, T. L., Park, D. S., & Davies, T. J. (2017). Understanding the processes underpinning patterns of phylogenetic regionalization. Trends in Ecology & Evolution, 32(11), 845-860.
ps <- ps_simulate()
# using kmeans clustering algorithm
terra::plot(ps_regions(ps, method = "kmeans"))
# to use a hierarchical clustering method, first we have to `ps_add_dissim()`
terra::plot(ps_regions(ps_add_dissim(ps), k = 7, method = "average"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.