% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{Cluster}
\alias{Cluster}
\title{Single-source base clustering}
\usage{
Cluster(
  Data,
  type = c("data", "dist"),
  distmeasure = "euclidean",
  normalize = FALSE,
  method = NULL,
  clust = "agnes",
  linkage = "ward",
  alpha = 0.625,
  StopRange = TRUE,
  ...
)
}
\arguments{
\item{Data}{A data matrix (objects in rows) or a precomputed distance matrix.}

\item{type}{\code{"data"} to compute a distance first, or \code{"dist"} if
\code{Data} is already a dissimilarity matrix.}

\item{distmeasure}{Distance measure (see \code{\link{Distance}}), used when
\code{type = "data"}.}

\item{normalize, method}{Normalisation controls passed to \code{\link{Distance}}.}

\item{clust}{Clustering backend; currently \code{"agnes"}.}

\item{linkage}{Agglomeration method. Default \code{"ward"}.}

\item{alpha}{Flexible-linkage parameter for \code{cluster::agnes}.}

\item{StopRange}{Logical; if \code{FALSE} and the dissimilarities fall outside
\code{[0, 1]} they are range-normalised for comparability.}

\item{...}{Ignored; accepted for backward compatibility (e.g. \code{gap},
\code{maxK}).}
}
\value{
A list with \code{DistM} (the dissimilarity matrix) and \code{Clust}
(an \code{agnes} object).
}
\description{
Cluster one data (or distance) matrix with agglomerative hierarchical
clustering. This is the Layer-2 baseline primitive of the MoSaIC framework:
run it on each tile on its own to see what each modality recovers before
integrating. It also underpins \code{\link{HierarchicalEnsembleClustering}}.
}
\examples{
data(mosaic_toy)
base1 <- Cluster(t(mosaic_toy$List[[1]]), type = "data",
                 distmeasure = "euclidean")
mosaic_labels(base1, k = 3)[1:6]
}
\seealso{
\code{\link{Distance}}, \code{\link{M_ABCpp}}
}
