Learn R Programming

healthyR (version 0.1.4)

kmeans_scree_data_tbl: K-Means Scree Plot Data Table

Description

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

Usage

kmeans_scree_data_tbl(.data)

Arguments

.data

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

Value

A nested tibble

Details

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

Examples

Run this code
# NOT RUN {
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 <-  kmeans_user_item_tbl(data_tbl, service_line, payer_grouping)

kmm_tbl <- kmeans_mapped_tbl(ui_tbl)

kmeans_scree_data_tbl(kmm_tbl)

# }

Run the code above in your browser using DataLab