Clustering analysis: k-means, hierarchical clustering in R
In R, you can perform clustering analysis, including k-means clustering and hierarchical clustering. Here are some examples: ## k-means clustering # Load the cluster package library(cluster) # Generate some data set.seed(123) x <- matrix(rnorm(200), ncol = 2) # Perform k-means clustering k <- 3 model <- kmeans(x, k) summary(model) # View the model summary # … Read more