plot_kmeans | R Documentation |
This function is designed to plot the clusters returned by K-means clustering.
plot_kmeans(
data,
res,
query,
dimred = "TSNE",
title = "Kmeans Clustering Results"
)
data |
A numeric |
res |
The clustering results returned by |
query |
A rowname in |
dimred |
The dimension reduction method, one of |
title |
The plot title. |
A ggplot.
Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu
Melville J (2022). _uwot: The Uniform Manifold Approximation and Projection (UMAP) Method for Dimensionality Reduction_. R package version 0.1.14, <https://CRAN.R-project.org/package=uwot> Jesse H. Krijthe (2015). Rtsne: T-Distributed Stochastic Neighbor Embedding using a Barnes-Hut Implementation, URL: https://github.com/jkrijthe/Rtsne H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016.
set.seed(10)
data <- iris[, 1:4]
rownames(data) <- paste0('gene', seq_len(nrow(data)))
dat.scl <- scale(data)
clus <- kmeans(dat.scl, 6)
plot_kmeans(data=dat.scl, res=clus, query='gene1', dimred='TSNE')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.