hi,

you also may be interested in this approach:

library(vegan)
library(sparcl)

data(dune)
dis <- vegdist(dune)
cluc <- hclust(dis, "complete")
grp <- cutree(cluc, 3)

par(mfrow = c(2, 1))

plot(cluc)
rect.hclust(cluc, 3)
r <- rect.hclust(cluc, 3)
text(cumsum(sapply(r,length)),
    rep(mean(tail(unique(cluc$hei),2)), length(r)),
    paste(unique(grp[cluc$ord])))

ColorDendrogram(cluc, grp, labels = paste(grp, rownames(dune), sep = "-"),
                main = "Cluster Dendrogram", branchlength = .175,
                ylab = "Height")

best,
kay



2012/3/3 Antonio Silva <aolinto.lst@gmail.com>

> Hi,
>
> I received an interesting answer, given by Elias T. Krainski, in another
> list. I repeat it here for just the record, it may be useful to someone
> else.
>
> library(vegan)
> data(dune)
> dis <- vegdist(dune)
> cluc <- hclust(dis, "complete")
> plot(cluc)
> r <- rect.hclust(cluc, 3)
> text(cumsum(sapply(r,length)),
>     rep(mean(tail(unique(cluc$hei),2)), length(r)),
>     paste(unique(grp[cluc$ord])))
>
> Best regards,
>
> Antonio
>
> 2012/3/2 Antonio Silva <aolinto.lst@gmail.com>
>
> > Hello,
> >
> > I would like to know if there is a way to indicate in a dendrogram the
> > number of each group, as indicated in cutree.
> >
> > In some dendrograms the number of a group does not correspond to its
> > position (group 3 may not be the third from left to right).
> >
> > For example:
> >
> > library(vegan)
> > data(dune)
> > dis <- vegdist(dune)
> > cluc <- hclust(dis, "complete")
> > plot(cluc)
> > rect.hclust(cluc, 3)
> > grp <- cutree(cluc, 3)
> > grp
> >
> > Note that the group of objects 17, 19, 11 and 18, placed in the left of
> > the dedrograma, is the "group number 3", and group of objects 1,2, ...,
> 7,placed in
> > the middle, is "group number 1".
> >
> > I'd like to indicate in the dendrogram, beside the vertical bars of each
> > cluster, their numbers: 3, 1, 2.
> >
> > See https://www.crops.org/images/publications/cs/42/5/1584f4.jpeg for
> > example.
> >
> > Thanks in advance for any hep. All the best,
> >
> > Antônio
> >
> > --
> > Antônio Olinto Ávila da Silva
> > Instituto de Pesca (Fisheries Institute)
> > São Paulo, Brasil
> >
>
>
>
> --
> Antônio Olinto Ávila da Silva
> Biólogo / Oceanógrafo
> Instituto de Pesca (Fisheries Institute)
> São Paulo, Brasil
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>

	[[alternative HTML version deleted]]

