% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-evaluation.R
\name{mosaic_labels}
\alias{mosaic_labels}
\title{Extract a flat partition from a MosaiClusteR result}
\usage{
mosaic_labels(object, k, linkage = "ward")
}
\arguments{
\item{object}{A MosaiClusteR result (e.g. from \code{\link{M_ABCpp}}), an
\code{agnes}/\code{hclust} object, or a distance matrix.}

\item{k}{Number of clusters.}

\item{linkage}{Linkage used when \code{object} is a bare distance matrix.}
}
\value{
An integer vector of cluster labels, named by object.
}
\description{
Cuts the hierarchical clustering carried in a MosaiClusteR result object into
\code{k} groups. Works with any method returning a \code{Clust} element (an
\code{agnes}/\code{hclust} object) and/or a \code{DistM}.
}
\examples{
set.seed(1)
s <- paste0("o", 1:20)
L <- list(matrix(rnorm(20 * 40), 20, dimnames = list(s, NULL)),
          matrix(rnorm(20 * 50), 20, dimnames = list(s, NULL)))
fit <- M_ABCpp(L, numsim = 30)
mosaic_labels(fit, k = 3)
}
