Description Usage Arguments Value Examples
View source: R/ForVisualizeData.R
Prepare data for visualize in less dimention
1 | forvisualData(data, alg.type = c("tSNE", "PCA", "UMAP"))
|
data |
a data matrix with n rows representing samples and m columns representing genes. |
alg.type |
if alg.type == "tSNE" to reduce the dimension of the data, the tSNE method is used (the default). if alg.type == "PCA" the PCA method is used and if alg.type == "UMAP" the UMAP method is used. |
Double matrix of components (PCA) or dimensions (tSNE, UMAP)
1 2 3 4 5 6 7 8 9 10 | data = rbind(matrix(rnorm(1000, mean=50), nrow = 500, ncol = 6),
matrix(rnorm(100), ncol = 6, nrow = 500))
labels = factor(cbind(rep(1, 500), rep(2, 500)))
get_data <- forvisualData(data, "tSNE")
ggplot(data.frame(get_data), aes(x = get_data[,1], y = get_data[,2])) +
geom_point(aes(color = labels))+
ylab("dim2")+
xlab("dim1")+
ggtitle("tSNE")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.