From 5a22a4ee1346c9b1af219dcee712aa1c92ca5fae Mon Sep 17 00:00:00 2001 From: "Kelly N. Bodwin" Date: Tue, 26 Jul 2022 03:20:35 -0400 Subject: [PATCH] minor tweak to within_cluster_sse --- R/metric-sse.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/metric-sse.R b/R/metric-sse.R index e741f894..3b0b2f3c 100644 --- a/R/metric-sse.R +++ b/R/metric-sse.R @@ -50,7 +50,8 @@ within_cluster_sse <- function(object, new_data = NULL, .cluster = factor(paste0("Cluster_", .cluster)) ) %>% dplyr::group_by(.cluster) %>% - dplyr::summarize(wss = sum(dist)) + dplyr::summarize(wss = sum(dist), + n_obs = n()) } return(res)