% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unsupervised-clustering.R
\name{calc_wss}
\alias{calc_wss}
\title{Calculate Within-Cluster Sum of Squares for Different k}
\usage{
calc_wss(data, max_k = 10, nstart = 25)
}
\arguments{
\item{data}{A data frame or tibble}

\item{max_k}{Maximum number of clusters to test (default: 10)}

\item{nstart}{Number of random starts for each k (default: 25)}
}
\value{
A tibble with columns \code{k} (number of clusters) and
\code{tot_withinss} (total within-cluster sum of squares).
}
\description{
Used for elbow method to determine optimal k
}
\examples{
\donttest{
wss <- calc_wss(iris[, 1:4], max_k = 6)
plot(wss$k, wss$tot_withinss, type = "b")
}

}
