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)
clustering <- perioclust(D1 = distance, D2 = constraint, alpha = 0.7,k=7,method="ward.D2")
clustering <- perioclust_subdivide(clustering,cluster = 5, nb_class = 2)
#subdivide more than one cluster (number of cluster 7)
clustering2 <- perioclust(D1 = distance, D2 = constraint,0.7,k=7, method = "ward.D2")
clustering2 <- perioclust_subdivide(clustering2,cluster = c(5,7), nb_class = c(2,2))
Run the code above in your browser using DataLab