Please refer to the attached code:
train <- read.csv("~/Desktop/R/2014data.csv")
d <- dist(train, method = "euclidean") # distance matrix
fit <- hclust(d, method="ward")
plot(fit)
Here is the output figure:
How to cut this dendrogram in 4-5 layers and show the output (texts)?