hai_umap_plot {healthyR.ai} | R Documentation |
UMAP and K-Means Cluster Visualization
Description
Create a UMAP Projection plot.
Usage
hai_umap_plot(.data, .point_size = 2, .label = TRUE)
umap_plt(.data, .point_size = 2, .label = TRUE)
Arguments
.data |
The data from the |
.point_size |
The desired size for the points of the plot. |
.label |
Should |
Details
This takes in umap_kmeans_cluster_results_tbl
from the umap_list()
function output.
Value
A ggplot2 UMAP Projection with clusters represented by colors.
Author(s)
Steven P. Sanderson II, MPH
See Also
-
https://github.com/jlmelville/uwot (GitHub)
-
https://github.com/jlmelville/uwot (arXiv paper)
Other UMAP:
hai_umap_list()
Examples
library(healthyR.data)
library(dplyr)
library(broom)
library(ggplot2)
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
)
kmm_tbl <- hai_kmeans_mapped_tbl(uit_tbl)
ump_lst <- hai_umap_list(.data = uit_tbl, kmm_tbl, 3)
hai_umap_plot(.data = ump_lst, .point_size = 3)
[Package healthyR.ai version 0.1.0 Index]