data(datangkor)
#network stratigraphic data (Network)
network <- datangkor$stratigraphy
#contingency table
cont <- datangkor$contingency
#obtain the dissimilarities matrices
distance <- CAdist(cont, nPC = 11)
constraint <- adjacency(network)
#You can also run hclustcompro with the dist matrix directly (number of cluster 7)
tree <- hclustcompro(d = list(distance, constraint), weight = 0.7,method="ward.D2")
clustering <- hclustcompro_cutree(tree, k = 5)
Run the code above in your browser using DataLab