Here is the code I am using:

m <- read.csv("data_unsorted.csv",header=TRUE)
m <- na.omit(m)
cs <- hclust(dist(t(m),method="euclidean"),method="complete")
ds <- as.dendrogram(cs)

In this case, m is a 106x40 matrix of doubles.  When I change the order of
the columns, I get different results...

Thanks,
RC


On Mon, Nov 15, 2010 at 2:13 PM, Peter Langfelder <
peter.langfel...@gmail.com> wrote:

> On Mon, Nov 15, 2010 at 2:07 PM, rchowdhury <rchowdh...@alumni.upenn.edu>
> wrote:
> >
> > Hello,
> >
> > I am using the hclust function to cluster some data.  I have two separate
> > files with the same data.  The only difference is the order of the data
> in
> > the file.  For some reason, when I run the two files through the hclust
> > function, I get two completely different results.
> >
> > Does anyone know why this is happening?  Does the order of the data
> matter?
>
> No, order of the data should not matter. However, hclust takes a
> distance structure, not a matrix, so the problem may be in how you
> create the distance. Can you provide an example?
>
> Peter
>

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to