| pca_pairs_kmeans_plot | R Documentation |
Creates a pairs plot of PCA scores coloured by k-means cluster assignment.
pca_pairs_kmeans_plot(
dataset,
pca.result,
num.clusters = 3,
kmeans.result = NULL,
pcas = c(1, 2, 3, 4, 5)
)
dataset |
Dataset used in the PCA. |
pca.result |
PCA result object. |
num.clusters |
Number of clusters. |
kmeans.result |
Optional precomputed k-means result. |
pcas |
Principal components to include. |
A ggmatrix object.
datamat <- matrix(
rnorm(30),
nrow = 6,
dimnames = list(paste0("x", 1:6), paste0("s", 1:5))
)
metadata <- data.frame(class = factor(c("A", "A", "B", "B", "A")))
dataset <- list(data = datamat, metadata = metadata)
pca_res <- pca_analysis_dataset(dataset)
pca_pairs_kmeans_plot(dataset, pca_res, num.clusters = 2, pcas = 1:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.