hai_kmeans_scree_data_tbl: K-Means Scree Plot Data Table

View source: R/kmean-funcs.R

hai_kmeans_scree_data_tblR Documentation

K-Means Scree Plot Data Table

Description

Take data from the hai_kmeans_mapped_tbl() and unnest it into a tibble for inspection and for use in the hai_kmeans_scree_plt() function.

Usage

hai_kmeans_scree_data_tbl(.data)

kmeans_scree_data_tbl(.data)

Arguments

.data

You must have a tibble in the working environment from the hai_kmeans_mapped_tbl()

Details

Takes in a single parameter of .data from hai_kmeans_mapped_tbl() and transforms it into a tibble that is used for hai_kmeans_scree_plt(). It will show the values (tot.withinss) at each center.

Value

A nested tibble

Author(s)

Steven P. Sanderson II, MPH

See Also

Other Kmeans: hai_kmeans_automl_predict(), hai_kmeans_automl(), hai_kmeans_mapped_tbl(), hai_kmeans_obj(), hai_kmeans_scree_plt(), hai_kmeans_tidy_tbl(), hai_kmeans_user_item_tbl()

Examples

library(healthyR.data)
library(dplyr)

data_tbl <- healthyR_data %>%
  filter(ip_op_flag == "I") %>%
  filter(payer_grouping != "Medicare B") %>%
  filter(payer_grouping != "?") %>%
  select(service_line, payer_grouping) %>%
  mutate(record = 1) %>%
  as_tibble()

ui_tbl <- hai_kmeans_user_item_tbl(
  .data = data_tbl,
  .row_input = service_line,
  .col_input = payer_grouping,
  .record_input = record
)

kmm_tbl <- hai_kmeans_mapped_tbl(ui_tbl)

hai_kmeans_scree_data_tbl(kmm_tbl)


healthyR.ai documentation built on April 3, 2023, 5:24 p.m.