daily pastebin goal
92%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(ggplot2)
  2. library("cluster")
  3. library(factoextra)
  4.  
  5. head(iris)
  6. cluster<-hclust(dist(iris[,3:4]))
  7. plot(cluster)
  8. a<-cutree(cluster,3)
  9. plot(hclust(dist(a)))
  10.  
  11. df<-scale("USArrests")
  12. head(df, h=10)
  13. set.seed(123)
  14. b<-kmeans(df,3,nstart = 100)
  15.  
  16. fviz_cluster(b,data=df,palette=c(""), elipse.type="convex")
RAW Paste Data
Top