| hai_kmeans_tidy_tbl | R Documentation |
K-Means tidy functions
hai_kmeans_tidy_tbl(.kmeans_obj, .data, .tidy_type = "tidy") kmeans_tidy_tbl(.kmeans_obj, .data, .tidy_type = "tidy")
.kmeans_obj |
A |
.data |
The user item tibble created from |
.tidy_type |
"tidy","glance", or "augment" |
Takes in a k-means object and its associated user item tibble and then
returns one of the items asked for. Either: broom::tidy(), broom::glance()
or broom::augment(). The function defaults to broom::tidy().
A tibble
Steven P. Sanderson II, MPH
Other Kmeans:
hai_kmeans_automl_predict(),
hai_kmeans_automl(),
hai_kmeans_mapped_tbl(),
hai_kmeans_obj(),
hai_kmeans_scree_data_tbl(),
hai_kmeans_scree_plt(),
hai_kmeans_user_item_tbl()
library(healthyR.data) library(dplyr) library(broom) 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() uit_tbl <- hai_kmeans_user_item_tbl( .data = data_tbl, .row_input = service_line, .col_input = payer_grouping, .record_input = record ) km_obj <- hai_kmeans_obj(uit_tbl) hai_kmeans_tidy_tbl( .kmeans_obj = km_obj, .data = uit_tbl, .tidy_type = "augment" ) hai_kmeans_tidy_tbl( .kmeans_obj = km_obj, .data = uit_tbl, .tidy_type = "glance" ) hai_kmeans_tidy_tbl( .kmeans_obj = km_obj, .data = uit_tbl, .tidy_type = "tidy" ) %>% glimpse()