View source: R/plotting_functions.R
plot_embedding | R Documentation |
Plot embedding
plot_embedding(
matrix,
labels = NULL,
method = "pca",
colors = RColorBrewer::brewer.pal(length(unique(labels)), "Set1"),
seed = 1,
point_size = 1,
cores = 1
)
matrix |
Input matrix. |
labels |
Input labels. |
method |
Method to use for dimensionality reduction. |
colors |
Colors to use for the plot. |
seed |
Seed for the random number generator. |
point_size |
Size of the points. |
cores |
Set the number of threads when setting |
An embedding plot
data("example_matrix")
samples_use <- 1:200
plot_data <- example_matrix[samples_use, ]
labels <- sample(
c("A", "B", "C", "D", "E"),
nrow(plot_data),
replace = TRUE
)
plot_embedding(
plot_data,
labels,
method = "pca",
point_size = 2
)
plot_embedding(
plot_data,
labels,
method = "tsne",
point_size = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.