calc_wss: Calculate within cluster sum of squares

View source: R/calc_wss.R

calc_wssR Documentation

Calculate within cluster sum of squares

Description

Calculate within cluster sum of squares

Usage

calc_wss(
  clust_df,
  dist_obj = NULL,
  dist_mat = NULL,
  clust_col = "clust",
  do_sample = FALSE
)

Arguments

clust_df

Dataframe with column of cluster membership.

dist_obj

Distance object from which clusters were generated.

dist_mat

Result from as.matrix(dist_obj), or equivalent. Required if dist_obj is not supplied.

clust_col

Character. Name of column in clust_df that contains the clusters.

do_boot

Logical. Sample clust_col (without replacement) before calculation. As step in gap-statistic calculation.

Value

Dataframe of within group sum-of-squares for each cluster.


Acanthiza/envCluster documentation built on July 16, 2025, 10:17 p.m.