[R] Plotting hclust() results

reichm@@j m@iii@g oii sbcgiob@i@@et reichm@@j m@iii@g oii sbcgiob@i@@et
Tue Aug 6 04:25:48 CEST 2019


R Help Forum

I have output from hierarchal clustering and want to plot the results using
the ggplot2 function. Where I have a scatter plot with 5 lines representing
the 5 clusters. I assuming I need to transform the data into three columns
(like) cluster, variable, and value. Not an issue but was wondering if I
could plot the data as is.  

  Cluster     A     B     C     D     E     F
    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1       1  0.67  0.56  0.54  0.03 -0.97 -1.09
2       2  0.52  0.43  0.51  0.05 -0.86 -0.96
3       3  0.2   0.3   0.19  0.08  0.02  0.09
4       4 -1.3  -1.13 -1.78 -0.05 -0.23 -0.23
5       5 -1.6  -1.3  -1.34 -0.23 -0.45 -0.45

Something like

Cluster Var	Value
1	A	0.67
1	B	0.56 etc

 Then group by cluster??

Jeff



More information about the R-help mailing list