Displaying 20 results from an estimated 1000 matches similar to: "hclust and plot functions work, cutree does not"
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 the same labeling?
rect.hclust() is useful to display the classes
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
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(srndpchc20000 )
srndclass20000 =
2013 Aug 22
1
Interpreting the result of 'cutree' from hclust/heatmap.2
I have the following code that perform hiearchical clustering and plot
them in heatmap.
__
library(gplots)
set.seed(538)
# generate data
y <- matrix(rnorm(50), 10, 5, dimnames=list(paste("g", 1:10, sep=""),
paste("t", 1:5, sep="")))
# the actual data is much larger that the above
# perform hiearchical clustering and plot heatmap
test <- heatmap.2(y)
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
2003 Dec 11
1
cutree with agnes
Hi,
this is rather a (presumed) bug report than a question because I can solve
my personal statistical problem 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")
2003 Dec 11
1
cutree with agnes
Hi,
this is rather a (presumed) bug report than a question because I can solve
my personal statistical problem 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")
2008 May 30
0
Problems with hclust and/or cutree.
I have been attempting to do some work using hclust, and have run
into a (possibly subtle) problem.
The background is that I constructed a dissimilarity 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)
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
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 profiles
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 Distance and Ward's method)
More
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
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=0 or 58965231, it looks like the range of data allowed by
the data
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
2012 Mar 27
2
Constructing Distance matrix for hclust
Hi,
I have similarity value between string pairs in a mysql database.
I need to construct the distance matrix which hclust can take and cluster
the strings. Most of the examples I came across show how to construct the
distance matrix using dist function.
How can I code to construct distance matrix using the data in mysql db.
Thanks a lot for any help.
[[alternative HTML version deleted]]
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. labels that were an entire table with several columns of information,
or
2012 Oct 11
2
extracting groups from hclust() for a very large matrix
Hello,
I'm having trouble figuring out how to see resulting groups (clusters)
from my hclust() output. I have a very large matrix of 4371 plots and 29
species, so simply looking at the graph is impossible. There must be a
way to 'print' the results to a table that shows which plots were in
what group, correct?
I've attached the matrix I'm working with (the whole thing
2006 May 08
1
finding centroids of clusters created with hclust
Hello,
Can someone point me to documentation or ideas on how to calculate the
centroids of clusters identified with hclust ?
I would like to be able to chose the number of clusters (in the style of
cutree) and then get the centroids of these clusters.
This seems like a quite obvious task to me, but I haven't been able to
put my hands on a relevant command.
Thank you,
Moritz
1999 Jul 07
1
hclust
I'm using the hclust method from the package mva (pre-compiled-version
on Win NT) and would like to cut the tree in pieces.
Have someone implemented the function cutree (as in S-PLUS) in R?
Many thanks
Markus Huerzeler
--
Dr. Markus Huerzeler Phone: +41 / 61 / 686 98 83
AICOS Technologies AG Fax: +41 / 61 / 686 98 88
Efringerstrasse 32 mailto:mhuerzeler at
2007 Oct 26
2
cut.dendrogram and cutree
Hi!
In the example:
hc <- hclust(dist(USArrests), "ave")
dend1 <- as.dendrogram(hc)
dend2 <- cut(dend1, h=70)
Do the branches "Branch 1", "Branch 2", "Branch 2"...in dend2$upper
str(dend2$upper)
--[dendrogram w/ 2 branches and 4 members at h = 152]
|--[dendrogram w/ 2 branches and 2 members at h = 77.6]
| |--leaf "Branch 1" (h=