Exporting hclust cluster membership

2019-03-31 15:13发布

I am new to R. I am trying to do hclust and export the cluster membership. I have used the following. Is this correct or is there a better way?

FCtable1<-as.matrix(read.delim("table1.txt", row.names=1, header=TRUE, sep="\t"))
Disttab1<-dist(FCtable1, method="euclidean")
Hclustout1<-hclust(Disttab1, method="average")
clustnumber<- cutree(Hclustout1, h=1000)
tab1clustn <-data.frame(FCtable1, clustnumber)
write.table(tab1clustn,  file=" tab1clustn.xls", row.names=T, sep="\t")

Thanks R

标签: r hclust
0条回答
登录 后发表回答