comat <- matrix(sample(0:1000, size = 500, replace = TRUE, prob = 1/1:1001),
20, 25)
rownames(comat) <- paste0("Site",1:20)
colnames(comat) <- paste0("Species",1:25)
dissim <- dissimilarity(comat, metric = "all")
# User-defined number of clusters
tree <- hclu_hierarclust(dissim,
optimal_tree_method = "best",
n_clust = 5:10)
tree
a <- bioregionalization_metrics(tree,
dissimilarity = dissim,
species_col = "Node2",
site_col = "Node1",
eval_metric = "anosim")
find_optimal_n(a, criterion = 'increasing_step', plot = FALSE)
Run the code above in your browser using DataLab