[R] Dendrogram

jim holtman jholtman at gmail.com
Sun Oct 14 21:05:34 CEST 2007


assign then names to the rows in the dataframe:

row.names(d) <- c("Italy", "France", "Spain", ...)

On 10/14/07, Alessandra Trimarchi <telealeteia at yahoo.it> wrote:
> Dear r-help mailing list,
>  here there is a data-frame of 24 observations and 7 variables.
>    W3 D3    P3   T3   U3 V3 R3
> 1  31.3 52 50200 1.67 59.4 55 57
> 2  33.0 61 45684 0.83 62.0 64 85
> 3  29.6 55 30455 0.60 56.6 45 52
> 4  28.0 59  8858 0.96 22.1 40 45
> 5  29.1 53  8334 0.63 42.9 46 51
> 6  23.1 79   312 9.87 69.8 30 38
> 7  19.7 86  1611 0.56 30.6 18 24
> 8  29.3 54  1580 0.78 28.2 45 58
> 9  29.4 53  4045 0.72 30.2 43 62
> 10 21.7 73  3180 0.62 19.0 15 31
> 11 28.0 56  7583 0.74 28.6 35 56
> 12 22.9 77   467 0.05 28.6 35 40
> 13 18.9 91  4221 0.26 36.0 14 25
> 14 17.5 90 11626 0.26 29.2 10 17
> 15 18.2 91 10800 0.05 30.4 13 20
> 16 19.1 84 27840 0.28 37.9 13 24
> 17 18.4 90  1349 0.01 22.7 14 19
> 18 23.0 74   573 0.62 35.6 26 44
> 19 19.5 85 28233 0.36 29.7 14 31
> 20 17.6 94   896 0.10 50.9 14 18
> 21 17.1 99  4620 0.25 36.8 12 20
> 22 20.9 87  1888 1.82 39.6 21 32
> 23 24.3 69  2114 0.95 77.0 22 41
> 24 17.6 94  1101 1.77 44.0 14 19
> I have done the cluster analysis using the hclust function and then I visualize the cluster dendrogram with the function plot:
>
>  clust1960<-hclust(d, method = "centroid", members=NULL)
>  plot(clust1960)
>  clust_1960<-as.dendrogram(clust1960)
>  order.dendrogram(clust_1960)
>
>  This is all I need, but I would like to specify the 24 observations that represent countries ( i.g: Italy=1,France=2, Spain=3, Portugal=4 ...) in the cluster dendrogram. How can I see countries' names in the figure instead of numbers?
>  Cordially
>  Alex
>
>
> ---------------------------------
>
> ---------------------------------
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list