Description Usage Arguments Value Examples
cluster function will draw Clusters for Groups analysis.
1 |
data |
input data.frame |
x |
x variable |
y |
y variable |
class |
class variable |
title |
main title |
subtitle |
subtitle |
caption |
caption |
An object of class ggplot
1 2 3 4 5 6 7 8 9 10 11 | # Compute data with principal components
df <- iris[c(1, 2, 3, 4)]
pca_mod <- prcomp(df) # compute principal components
# Data frame of principal components
df_pc <- data.frame(pca_mod$x, Species=iris$Species) # dataframe of principal components
plot<- cluster(data=df_pc,x="PC1",y="PC2",class="Species",
title="Iris Clustering",
subtitle="With principal components PC1 and PC2 as X and Y axis",
caption="Source: Iris")
plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.