pheatmap in R. How to get clusters
res=RES$i
DF<-data.frame("A","B",stringsAsFactors = FALSE)
for (i in 1:length(res$tree_row$order)){
ROW_CLUSTER_ORDER=i
ROW_CLUSTER_NAME=res$tree_row$labels[res$tree_row$order[i]]
DF[ROW_CLUSTER_ORDER,] <- list(ROW_CLUSTER_ORDER,ROW_CLUSTER_NAME)
}
# head(DF)
colnames(DF)<-c("related_plot_line_num","GEMNUMID")
# head(AIN2)
#print("422")
MIN<-merge(AIN2,DF,by = "GEMNUMID")
浙公网安备 33010602011771号