On Wed, Sep 26, 2012 at 3:11 PM, RCar <ryan.carstens@utsouthwestern.edu>wrote:

> All,
> Relatively new R user so this is probably an easy question to answer.
> I am able to generate a cluster for my dataset using hclust() then ploting
> the data with plot().
> This results in an image with a dendrogram with my sample names along the
> bottom.  Great!
> However, I now need a way to get that sample order from the image into
> excel.
>

Why? What does the order of labels in a dendrogram mean ?
But if you insist

hc <- hclust(dist(USArrests), "ave")
plot(hc)
str(hc)
hc$labels[hc$order]

?write.table



> i.e. sample 7 was on the far left, sample 19 was in position 2, sample 93
> was in position 3, etc.
> As of now the only way for me to do this is to manually type the samples
> from the image into a worksheet.
> Very time consuming as I've got a couple hundred samples and several
> different dendrograms!
> Any thoughts?
>
> Thanks so much!
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Simple-Question-About-Exporting-Back-to-Excel-tp4644296.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@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.
>

	[[alternative HTML version deleted]]


