\name{perioclust_subdivide}
\alias{perioclust_subdivide}
\title{
Subdivide a cluster after running perioclust.
}

\description{
Allow the user to split one cluster into sub-clusters. This function only works with 'perioclust_cl' object returned by the perioclust function.
}

\usage{
perioclust_subdivide(perioclust_cl,cluster,nb_class)
}

\arguments{
  \item{perioclust_cl }{A perioclust_cl object}
  \item{cluster }{The number of the cluster. Numbered from left to right on the dendrogram (1, 2, ...)}
  \item{nb_class }{The number of sub-clusters you want}
}

\value{
  see \link[SPARTAAS]{perioclust}
}

\author{
A. COULON

L. BELLANGER

P. HUSI
}

\examples{
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))
}
