# NOT RUN {
data(USArrests)
# Compute hierarchical clustering and cut into 4 clusters
res <- hcut(USArrests, k = 4, stand = TRUE)
# Cluster assignements of observations
res$cluster
# Size of clusters
res$size
# Visualize the dendrogram
fviz_dend(res, rect = TRUE)
# Visualize the silhouette
fviz_silhouette(res)
# Visualize clusters as scatter plots
fviz_cluster(res)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab