% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nugget-clustering.R
\name{nugget_cluster}
\alias{nugget_cluster}
\title{Data-nugget clustering}
\usage{
nugget_cluster(
  data,
  k,
  method = c("kmeans", "ward"),
  max_nuggets = NULL,
  nugget_args = list()
)
}
\arguments{
\item{data}{A numeric matrix (objects in rows) \emph{or} a precomputed
\code{\link{create_data_nuggets}{data_nugget}} object. For multi-source
data, column-bind the per-source matrices first (the direct/\code{ADC}
strategy) or pass a single fused matrix.}

\item{k}{Number of clusters.}

\item{method}{Weighted clusterer for the nugget centres: \code{"kmeans"}
(WWCSS) or \code{"ward"} (weighted Ward).}

\item{max_nuggets, nugget_args}{Passed to \code{\link{create_data_nuggets}}
when \code{data} is a raw matrix.}
}
\value{
A list of class \code{"nugget_cluster"} with \code{cluster} (labels
for the original objects), \code{nugget_cluster} (labels for the nuggets)
and the \code{nuggets} object.
}
\description{
Cluster a (potentially large) data set by first compressing its observations
into weighted data nuggets (\code{\link{create_data_nuggets}}), clustering the
nugget centres with a weighted clusterer, and mapping the nugget labels back
to the original observations. This is the clustering analogue of the
data-nugget weighting used by \code{\link{M_ABCpp}} and follows
\code{DN.Wkmeans} / \code{DN.Whclust} from the WCluster package.
}
\examples{
data(mosaic_toy)
X <- do.call(cbind, mosaic_toy$List)        # fuse sources (objects in rows)
fit <- nugget_cluster(X, k = 3, max_nuggets = 30)
table(fit$cluster)
}
\references{
Cherasia et al. (2023); Dey et al. (2025), WCluster.
}
\seealso{
\code{\link{create_data_nuggets}}, \code{\link{Wkmeans}}
}
