How to color a dendrogram's labels according to defined groups? (in R)

后端 未结 3 1111
情深已故
情深已故 2021-01-13 03:46

I have a numeric matrix in R with 24 rows and 10,000 columns. The row names of this matrix are basically file names from which I have read the data corresponding to each of

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 04:31

    You may take a look at this tutorial, which displays several solutions for visualizing dendograms in R by groups

    https://rstudio-pubs-static.s3.amazonaws.com/1876_df0bf890dd54461f98719b461d987c3d.html

    However, I think the best solution, suit for your data, is offered by the package 'dendextend'. See the tutorial (the example concerning the 'iris' dataset, which is similar to your problem): https://nycdatascience.com/wp-content/uploads/2013/09/dendextend-tutorial.pdf

    See also the vignette: http://cran.r-project.org/web/packages/dendextend/vignettes/Cluster_Analysis.html

提交回复
热议问题