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
tree = hclustcompro(d = list(distance, constraint), weight = c(0.7, 0.3), method = "ward.D2")
cluster = hclustcompro_cutree(tree, k=5, reorder=TRUE, letter=TRUE)
Run the code above in your browser using DataLab