powered by
Groups the points with the clusters given by k-means in a 2D PCA scores plot.
pca_kmeans_plot2D(dataset, pca.result, num.clusters = 3, pcas = c(1, 2), kmeans.result = NULL, labels = FALSE, bw=FALSE, ellipses = FALSE, leg.pos = "right", xlim = NULL, ylim = NULL)
list representing the dataset from a metabolomics experiment.
prcomp object with the PCA results.
number of clusters of k-means.
vector with the principal components to be plotted.
result from k-means. If null k-means is performed in the function.
boolean value indicating if the samples' labels will be shown.
boolean value that indicates if an ellipse will be drawn on each group of the metadata's variable. Ellipses will not be drawn if bw=TRUE.
if TRUE, it will be displayed a black and white plot. It defaults to FALSE.
legend position.
vector with two positions with the x-axis limits.
vector with two positions with the y-axis limits.
# NOT RUN { ## Example of a 2D PCA k-means plot pca.result = pca_analysis_dataset(cachexia) pca_kmeans_plot2D(cachexia, pca.result, num.clusters = 3, pcas = c(1,2)) # }
Run the code above in your browser using DataLab