search for: cutree

Displaying 20 results from an estimated 119 matches for "cutree".

Did you mean: ctree
2015 Jun 06
2
Request: making cutree S3 in R?
Hello all, A question/suggestion: I was wondering if there is a chance of changing stats::cutree to be S3 and use cutree.hclust? For example: cutree <- function(tree, k = NULL, h = NULL,...) { UseMethod("cutree") } cutree.hclust <- stats::cutree # This will obviously need the actual content of stats::cutree This would be nicer for people like me to add new methods to cut...
2003 Dec 11
1
cutree with agnes
...oblem by working with hclust instead of agnes. I have done a complete linkage clustering on a dist object dm with 30 objects with agnes (R 1.8.0 on RedHat) and I want to obtain the partition that results from a cut at height=0.4. I run > cl1a <- agnes(dm, method="complete") > cutree(cl1a,h=0.4) [1] 1 2 3 4 5 6 3 7 3 8 9 10 3 11 12 13 14 15 3 16 17 3 18 19 20 [26] 21 3 22 18 23 But that's not true; correct is the solution obtained from hclust > clx <- hclust(dm) > cutree(cl1,h=0.4) [1] 1 2 1 2 3 4 1 2 1 3 4 5 1 4 6 7 8 4 1 5 2...
2003 Dec 11
1
cutree with agnes
...oblem by working with hclust instead of agnes. I have done a complete linkage clustering on a dist object dm with 30 objects with agnes (R 1.8.0 on RedHat) and I want to obtain the partition that results from a cut at height=0.4. I run > cl1a <- agnes(dm, method="complete") > cutree(cl1a,h=0.4) [1] 1 2 3 4 5 6 3 7 3 8 9 10 3 11 12 13 14 15 3 16 17 3 18 19 20 [26] 21 3 22 18 23 But that's not true; correct is the solution obtained from hclust > clx <- hclust(dm) > cutree(cl1,h=0.4) [1] 1 2 1 2 3 4 1 2 1 3 4 5 1 4 6 7 8 4 1 5 2...
2011 Dec 09
1
Help understanding cutree used for Dunn Index
Basic question: Is it correct to assume that when using cutree to set the # clusters (say k=4), cutree determines the clusters by the largest distances among all potential clusters? I've read the R help for cutree and am using it to define the number of groups to obtain Dunn Index scores (using clValid library) for cluster analysis (using Euclidean Distan...
2012 Mar 29
2
hclust and plot functions work, cutree does not
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) rownames(x) = c(source_tags_vec) clust_tree=hclust(as.dist(x),method="complete") plot(clust_tree) cutree(clust_tree,k=1:5) Similarity matrix is a...
2011 Sep 13
2
help with hclust and cutree
Hello, I would like to cut a hclust tree into several groups at a specific similarity. I assume this can be achieved by specifying the "h" argument with the specified similarity, e.g.: clust<-hclust(dist,"average") cut<-cutree(clust,h=0.65) Now, I would like to draw rectangles around the branches of the dendrogram highlighting the corresponding clusters, as is done by the function rect.hclust(). How can I achieve this with the ouput of cutree? I would appreciate your help! Best regards, Madeleine
2005 Sep 15
2
about cutree
Hi Everyone, I'm trying to use cutree to get the clusters after hclust. What I used is: mycluster<-cutree(cnclust,h=0.5) Now, my problem is, how can I get the actual clusters? Thanks! Best, Baoqiang Cao
2011 Sep 16
1
cutree() and rect.hclust(): different labelling of classes
I've found that while cutree() and rect.hclust() make the same classes for a given height in the dendrogram, the actual labeling of the classes is different. For example, both produce the same 4 classes but class 1 according to cutree() is class 4 according to rect.hclust(). Would it be possible that future versions provide t...
2012 Aug 12
0
Different cluster orderings from cutree() and cut.dendrogram()
Hi! I just discovered that cutree() and cut.dendrogram() do not assign the same cluster numberings when called on the same tree. More specifically, cutree() assigns cluster numbers by order of appearance in the data, while cut.dendrogram() sorts clusters by height (see example below). I guess this is for historical reasons? I'...
2011 Sep 12
1
hclust and cutree: identifying branches as classes
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=20000) #visualisation srndpchc20000 = cutree(srndpchc,h=20000) #returns 4 classes table(...
2008 May 30
0
Problems with hclust and/or cutree.
...arity matrix ``d1'' (it involved something called the ``Jaccard similarity coefficient''; I won't go into the details unless requested). I then did d2 <- as.dist(d1) try <- hclust(d2,method=ward) plot(try,labels=FALSE) After looking at the plot, I tried mmm <- cutree(try,h=7) and got the error message Error in cutree(try, h = 7) : the 'height' component of 'tree' is not sorted (increasingly); consider applying as.hclust() first I was much puzzled by this initially, since try is already an ``hclust'' object (I checked class(try))...
2001 Aug 22
1
cutree (PR#1067)
Full_Name: Anja von Heydebreck Version: 1.3.0 OS: Alpha Unix Submission from: (NULL) (141.14.19.61) Hi, I repeatedly obtained meaningless results from the function 'cutree' in the 'mva' package, when the argument 'h' was greater or equal to the maximum height occuring: > library('mva') > y [,1] [,2] [,3] [,4] [1,] 0 1 -1 1 [2,] 0 -1 1 0 [3,] 0 -1 1 1 [4,] -1 -2 1 0 > d <- dist...
2004 Jul 21
2
Cutting heatmap dendrogram
Hello, I've been clustering my data using hclust and cutting the resulting tree with cutree. Separately, I visualize the clusterings with heatmap. Is it possible to have the dendrogram on the heatmap reflect the cutree results? That is, instead of having one large dendrogram, it would have 4 or 25 in the example below. Any guidance on if that's possible or not, and what kinds of co...
2002 Jan 22
1
cutree using a vector for h giving meaningless results
I try to use the routine cutree to cut a tree (created by hclust) into several groups by specifiing the hight of the cut. a<-1:10 cutree(tree, h=a*100) The Matrix with group meberships returned is ok for most of the hights, but in some cases (as for example h=800 and h=900) the results don't make sense (group membership=...
2007 Feb 22
0
A question regarding "cutree"
Hi Everyone, I am doing hierarchical clustering analysis and have a question regarding "cutree". I am doing things like this: hc <- hclust(dist(X)) a <- cutree(hc, k=2) Basically "a" is a vector containing the assignments of 1 or 2 for each sample. May I know how "cutree" decides to assign 1 and 2's to each sample (in other words, how clusters 1 and 2 a...
2009 Sep 21
0
Help needed to clarify hclust and cutree algorithms
Dear R Helpers, I read carefully the documentation and all postings on the hclust and cutree functions, however some aspects of the tree ordering and cluster assignment performed by these functions remain unclear to me, so I would very much appreciate your help in making sure I get them right. Here is an example, with values chosen to illustrate the problems. I have a set of five profile...
2000 Jul 20
3
printing hclust with k clusters
howdy R friends, I've searched CRAN but to no avail... I'm trying to use mva's hclust and print out for say 10 clusters in batch. How do I do this? It's unclear if I can use cutree. thanks, John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To:...
2013 Aug 22
1
Interpreting the result of 'cutree' from hclust/heatmap.2
...sep=""))) # the actual data is much larger that the above # perform hiearchical clustering and plot heatmap test <- heatmap.2(y) __ What I want to do is to print the cluster member from each hierarchy of in the plot. I'm not sure what's the good way to do it. I tried this: cutree(as.hclust(test$rowDendrogram), 1:dim(y)[1]) But having problem in interpreting the result. What's the meaning of each value in the matrix? For example g9-9=8 . What does 8 mean here? 1 2 3 4 5 6 7 8 9 10 g1 1 1 1 1 1 1 1 1 1 1 g2 1 2 2 2 2 2 2 2 2 2 g3 1 2 2 3 3 3 3 3 3 3 g4 1 2 2...
2002 May 14
1
cutree() and horizontal dendrograms
When I use the function cutree(), the numbers of the clusters are not in the same order as the plotted dendrogram. Is there any way of sorting them so that they match the tree? Is it possible to plot a dendrogram horizontally, preferably with the branches to the right? This would enable some practical composite plots, e.g. lab...
2007 May 28
0
using cutree() to figure out the heatmap cluster labels on the left
I've been using heatmap(), hclust(), and cutree(), and I'm trying to figure out the column labels of the left (as opposed to the right) cluster. Using cutree(x, k=2), I get two clusters labeled 1 and 2. How do you figure out if cluster 2 is the one associated with the left cluster on the heatmap (instead of manually going to the heatmap)?...