Re: [R] Hclust

2016-10-11 Thread David L Carlson
- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of TJUN KIAT TEO Sent: Tuesday, October 11, 2016 2:57 AM To: r-help@r-project.org Subject: [R] Hclust For the hclust function in R, is there a predict function that would work to tell me which cluster does a new observation belong

Re: [R] hclust/dendrogram merging

2013-09-16 Thread Thomas Parr
From: Joshua Eckman josheck...@hotmail.com To: r-help@r-project.org r-help@r-project.org Subject: [R] hclust/dendrogram merging Message-ID: bay167-w1059032665f8387dd05cb26de...@phx.gbl Content-Type: text/plain I am working with protein blocking assays and the end result is a 2D matrix

Re: [R] hclust/dendrogram merging

2013-09-16 Thread Peter Langfelder
Joshua, I'm not sure I understand your aim correctly, but if I do, here's my advice: If you are able to find the clusters according to rows or columns using clustering, you must be using some kind of a distance matrix that encodes whether two antibodies should be in one bin for rows, and a

[R] hclust/dendrogram merging

2013-09-15 Thread Joshua Eckman
I am working with protein blocking assays and the end result is a 2D matrix describing which antibodies block the binding of other antibodies to the target antigen.I need to group the antibodies together into bins based on their combined profiles in both the row and column direction.I am able

[R] hclust segfault when using rpuDist

2013-06-04 Thread Kaiyin Zhong (Victor Chung)
Hi, dear list. I found that hclust causes segfault in R 3.0.1, here is the code after starting R --vanilla: test.data - function(dim, num, seed=17) { set.seed(seed) matrix(rnorm(dim * num), nrow=num) } m - test.data(120, 45) library(rpud) # load rpud with rpudplus d -

Re: [R] Hclust tree to Figtree w/ branch lengths

2013-01-19 Thread Julian Banchier
Hi, This worked: fit - hclust(d, method=ward) library(ape) p - (as.phylo(fit)) write.tree(p, file=MyNewick.tre) Cheers, J -- View this message in context: http://r.789695.n4.nabble.com/Hclust-tree-to-Figtree-w-branch-lengths-tp4655990p4656057.html Sent from the R help mailing list archive

[R] Hclust tree to Figtree w/ branch lengths

2013-01-18 Thread Julian Banchier
Hi, I'm doing hierarchical clustering, and want to export my dendrogram to a tree-viewing/editing software. I can do this by converting the data to Newick format (hc2Newick in ctc package), but I can't get branch lengths to show in the resulting phylogram. I figured it might help to convert my

Re: [R] hclust and plot functions work, cutree does not

2012-04-03 Thread vinod1
Sarah, . clust_tree=hclust(as.dist(x),method=complete) . plot(clust_tree) this produces a dendrogram, whereas . clust_tree=hclust(as.dist(x),method=complete) .cut = cutree(clust_tree,k=1:5) .plot(cut) produces a plot with 2 dots. The dissimilarity matrix x is

Re: [R] hclust and plot functions work, cutree does not

2012-04-03 Thread Peter Langfelder
On Tue, Apr 3, 2012 at 2:41 AM, vinod1 vinod.hegd...@gmail.com wrote: Sarah, .       clust_tree=hclust(as.dist(x),method=complete) .       plot(clust_tree) this produces a dendrogram, whereas .       clust_tree=hclust(as.dist(x),method=complete) .        cut = cutree(clust_tree,k=1:5) .  

[R] hclust and plot functions work, cutree does not

2012-03-29 Thread Vinod Hegde
Hi, I have the distance matrix computed and I feed it to hclust function. The plot function produces a dense dendrogram as well. But, the cutree function applied does not produce the desired list. Here is the code x=data.frame(similarity_matrix) colnames(x) = c(source_tags_vec)

Re: [R] hclust and plot functions work, cutree does not

2012-03-29 Thread Sarah Goslee
What does does not work mean? Do you get an error message? Or a warning? Or a result, but one that isn't what you expected? Did you look at the results of the example in ?cutree to make sure what the function does is what you think it should do? hc - hclust(dist(USArrests))

[R] hclust and ggplot2

2011-12-13 Thread wwreith
I saw an example online of taking hclust dendrogram and plotting it using ggplot2 and thought I would give it a try to see what it would look like. I get an error when trying to use ggplot; Error: ggplot2 doesn't know how to deal with data of class phylo. Regular plot works fine but I can't get

[R] hclust and cutree: identifying branches as classes

2011-09-12 Thread Laurent Fernandez Soldevila
Good afternoon, After cuting a hierarchical tree using cutree(), how to check correspondances between classes and branches? This is what we do: srndpchc - hclust(dist(srndpc$x[1:1000,1:3]),method=ward) #creation of hierarchical tree plclust(srndpchc,hmin=2) #visualisation srndpchc2 =

Re: [R] hclust and cutree: identifying branches as classes

2011-09-12 Thread Peter Langfelder
On Mon, Sep 12, 2011 at 4:59 AM, Laurent Fernandez Soldevila l.fernand...@yahoo.fr wrote: Good afternoon, After cuting a hierarchical tree using cutree(), how to check correspondances between classes and branches? This is what we do: srndpchc -

[R] hclust() memory issue

2011-03-14 Thread array chip
Hi, I have a microarray dataset of dimension 25000x30 and try to clustering using hclust(). But the clustering on the rows failed due to the size: y-hclust(dist(data),method='average') Error: cannot allocate vector of size 1.9 Gb I tried to increase the memory using memory.limit(size=3000),

Re: [R] hclust() memory issue

2011-03-14 Thread Ochsner, Scott A
) 798-6227 Fax: (713) 790-1275 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Monday, March 14, 2011 4:03 PM To: r-help@r-project.org Subject: [R] hclust() memory issue Hi, I have a microarray dataset of dimension

Re: [R] hclust() memory issue

2011-03-14 Thread array chip
PM Subject: RE: [R] hclust() memory issue John, First, why are you trying to cluster so many rows? Presumably, if this is a gene expression array dataset, most of the array features are not going to change across treatments/conditions and will be relatively uninformative. Try using a filter

Re: [R] hclust() memory issue

2011-03-14 Thread Thomas Lumley
A sochs...@bcm.edu r-help@r-project.org Sent: Mon, March 14, 2011 2:19:57 PM Subject: RE: [R] hclust() memory issue John, First, why are you trying to cluster so many rows?  Presumably, if this is a gene expression array dataset, most of the array features are not going to change across

[R] Hclust - Number of branch operations for every element

2010-12-19 Thread Lui
Hello everybody, I need to know how often every element in an hierarchical cluster was branched - just imagine a watering pot on the top of the hierarchical tree - the leafs should get water according to the number of branches that lie before them. For example: a - list() # initialize

Re: [R] hclust, does order of data matter?

2010-11-16 Thread Reshmi Chowdhury
I found the problem. For some reason, when I converted the list object with the data in it to numeric, the values changed. This resulted in different clustering results. Once that was fixed, the clustering was the same. Thanks for the responses! On Mon, Nov 15, 2010 at 2:37 PM, Peter

[R] hclust, does order of data matter?

2010-11-15 Thread rchowdhury
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

Re: [R] hclust, does order of data matter?

2010-11-15 Thread Peter Langfelder
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

Re: [R] hclust, does order of data matter?

2010-11-15 Thread Christian Hennig
I don't know how the hclust function is implemented, but generally in hierarchical clustering the result can be ambiguous if there are several distances of identical value in the dataset (or identical between-cluster distances occur when aggregating clusters). The role of the order of the data

Re: [R] hclust, does order of data matter?

2010-11-15 Thread Reshmi Chowdhury
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

Re: [R] hclust, does order of data matter?

2010-11-15 Thread Peter Langfelder
On Mon, Nov 15, 2010 at 2:19 PM, Reshmi Chowdhury rchowdh...@alumni.upenn.edu wrote: 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) As Christian said, you may want to

Re: [R] hclust with method = “ward”

2010-10-07 Thread Christian Hennig
On Wed, 6 Oct 2010, PeterB wrote: Thanks, Christian. This is really helpful. I was not aware of that equality, but now I can see it. I think you mean the inner sum over all distances in the distance matrix (for that cluster), which means that each distance is counted twice (which is why we

Re: [R] hclust with method = “ward”

2010-10-06 Thread PeterB
Apparently, the same issue exists in SAS, where there is an option to run the Ward algorithm based only on the distance matrix. Perhaps, a SAS user could confirm that or even check with SAS. Peter -- View this message in context:

Re: [R] hclust with method = “ward”

2010-10-06 Thread Christian Hennig
The k-means/Ward criterion can be written down in terms of squared Euclidean distances in a way that doesn't involve means. It is half the sum (over all clusters) of the sum (over all observations in a cluster) of all within-cluster squared dissimilarities, the inner sum divided by the cluster

Re: [R] hclust with method = “ward”

2010-10-06 Thread PeterB
Thanks, Christian. This is really helpful. I was not aware of that equality, but now I can see it. I think you mean the inner sum over all distances in the distance matrix (for that cluster), which means that each distance is counted twice (which is why we divide by 2). Peter Christian Hennig

[R] hclust with method = “ward”

2010-10-01 Thread PeterB
The clustering function hclust has a method = ward”, and apparently many people use that option. However, the Ward method seems to minimize an increase in the error sums of squares, which are calculated with respect to the cluster mean. However, hclust has only a dissimilarity matrix as an input.

[R] hclust information in a table

2010-07-13 Thread Ralph Modjesch
i try to show the result of the cluster-analysis (hclust, method=ward) in a table with following information first column: height second column: number of clusters third column: clustering information 0,041 | 20 | (3)-(5) 0,111 | 19 | (6)-(11) 0,211 | 18 |

[R] hclust too slow?

2009-11-17 Thread akonla
Hi, I am new to clustering in R and I have a dataset with approximately 17,000 rows and 8 columns with each data point a numerical character with three decimal places. I would like to cluster the 8 columns so that I get a dendrogram as an output. So, I am simply creating a distance matrix of

Re: [R] hclust too slow?

2009-11-17 Thread Charles C. Berry
On Tue, 17 Nov 2009, akonla wrote: Hi, I am new to clustering in R and I have a dataset with approximately 17,000 rows and 8 columns with each data point a numerical character with three decimal places. I would like to cluster the 8 columns so that I get a dendrogram as an output. So, I am

Re: [R] hclust too slow?

2009-11-17 Thread Anna Konstorum
Yikes, you are correct! Thank you so much. I reran the analysis with the rows and columns switched and it took no time at all. Thank you again for your help. On Tue, Nov 17, 2009 at 12:04 PM, Charles C. Berry cbe...@tajo.ucsd.eduwrote: On Tue, 17 Nov 2009, akonla wrote: Hi, I am new to

[R] hclust interrogation use of $merge for dendrogram annotation?

2008-08-01 Thread Ben Davies
Hi all, I've been doing some investigation to see if it is possible to implement an hclust/dendrogram related requirement that I've been given. So far ?hclust and a lot of googling haven't provided the information I'm looking for (I've been using R sporadically for a year). The requirement I

Re: [R] hclust graphics - plotting many points

2008-03-11 Thread Hans Ekbrand
-project.org Subject: [R] hclust graphics - plotting many points Hello. I have a distance matrix with lots of distances that I use hclust to organise. I then plot the results using the plot method of hclust. However, the plot itself takes around 20 mins to make due to there being ~700 things

[R] hclust graphics - plotting many points

2008-03-10 Thread Karin Lagesen
Hello. I have a distance matrix with lots of distances that I use hclust to organise. I then plot the results using the plot method of hclust. However, the plot itself takes around 20 mins to make due to there being ~700 things in the matrix that I have distances for. I thus would like to dump

Re: [R] hclust graphics - plotting many points

2008-03-10 Thread michael watson (IAH-C)
I'd recommend outputting either as pdf or as a windows metafile -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Karin Lagesen Sent: 10 March 2008 09:54 To: r-help@r-project.org Subject: [R] hclust graphics - plotting many points Hello. I have

Re: [R] hclust in heatmap.2

2007-12-06 Thread James W. MacDonald
affy snp wrote: Dear list, I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix x clustered only by columns and keep the original order of rows unchanged. Is there a way to do that in heatmap.2()? Thanks a lot! Any suggestions will be appreciated! From the help

Re: [R] hclust in heatmap.2

2007-12-06 Thread affy snp
Thanks Ashoka! Allen On Dec 6, 2007 12:27 AM, Ashoka Polpitiya [EMAIL PROTECTED] wrote: Check the Rowv, Colv options to heatmap.2 data(mtcars) x - as.matrix(mtcars) heatmap.2(x, Rowv=FALSE, dendrogram=column) -Ashoka Scientist - Pacific Northwest National Lab On Dec 5, 2007

Re: [R] hclust in heatmap.2

2007-12-06 Thread affy snp
Thanks James! Allen On Dec 6, 2007 9:21 AM, James W. MacDonald [EMAIL PROTECTED] wrote: affy snp wrote: Dear list, I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix x clustered only by columns and keep the original order of rows unchanged. Is there a way to

Re: [R] hclust in heatmap.2

2007-12-05 Thread Ashoka Polpitiya
Check the Rowv, Colv options to heatmap.2 data(mtcars) x - as.matrix(mtcars) heatmap.2(x, Rowv=FALSE, dendrogram=column) -Ashoka Scientist - Pacific Northwest National Lab On Dec 5, 2007 4:20 PM, affy snp [EMAIL PROTECTED] wrote: Dear list, I am using heatmap.2(x) to draw a heatmap.