`PartRec()` performs the recursive splitting step of the PART clustering algorithm. Given a subset of observations and a maximum number of clusters to evaluate, the function:
1. Checks whether the current subset is large enough to split at all. 2. Computes candidate partitions for `K = 1, …, Kmax` using a user-specified clustering method. 3. Selects the optimal number of clusters (`hatK`) using the Gap statistic. 4. Applies size constraints (`minSize`) to ensure meaningful splits. 5. When a split is accepted, recursively applies PART to each subcluster.
The output is either: * a vector representing an unsplit terminal cluster, or * a matrix whose columns represent recursively generated subclusters.
PartRec(X, Kmax, ind, cl.lab = NULL, ...)A numeric data matrix containing the observations in the cluster currently under consideration.
Maximum number of clusters to consider for the *current* (non-recursive) partitioning step.
A binary index vector of the same length as the number of rows in the original dataset. Values of `1` indicate membership in the current subset and `0` indicate exclusion. This index is updated recursively to track cluster identities across all levels of the dendrogram.
Optional list containing pre-computed cluster label vectors for `K = 1, …, Kmax`. If supplied, these labels are used instead of recomputing partitions. If `NULL`, labels are obtained through `findPartition()`. Default is `NULL`.
Additional parameters passed from the top-level `part()` function, provided as a list in `fixed.par`. Important values include `minSize`, `minDist`, `Kmax.rec`, `dist.method`, `cl.method`, `linkage`, `cor.method`, and others controlling the clustering algorithm and recursive stopping rules.