similar to: Help needed to clarify hclust and cutree algorithms

Displaying 20 results from an estimated 9000 matches similar to: "Help needed to clarify hclust and cutree algorithms"

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)
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'm hit by this difference when I want to get a vector of cluster
2010 Sep 22
0
How to Ignore NaN values in Rows when using hclust function in making Heatmap??
I am making heatmaps for a dataset (~ 300*600 matrix) with the following R script (I am not familiar with R and this is the first time I am using it). library("gplots") library("Cairo") mydata <- read.csv(file="data.csv", header=TRUE, sep=",") rownames(mydata)=mydata$Name mydata <- mydata[,2:297] mydatamatrix <- data.matrix(mydata) mydatascale
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
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)
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
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
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=
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 =
2006 Oct 29
0
identify.hclust() not working for me
I had a look at the online documentation, and didn't see from that what is my problem. If I should have, pardon me. Here is my session. As I understand the documentation, this should work with only an hclust object. I get a similar error when in include a FUN argument. I am using V2.4.0. > hc Call: hclust(d = dist(mtx2, method = "manh"), method =
2011 Mar 02
2
clustering problem
Hi, I have a gene expression experiment with 20 samples and 25000 genes each. I'd like to perform clustering on these. It turned out to become much faster when I transform the underlying matrix with t(matrix). Unfortunately then I'm not anymore able to use cutree to access individual clusters. In general I do something like this: hc <- hclust(dist(USArrests), "ave")
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)
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
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")
2002 Feb 08
0
packages for extracting subtrees
Hi. I did write those functions, and sent them (I thought) to one of the R maintainers to see whether they would be appropriate for inclusion (because I'd seen some requests on the mailing lists). However, I'm happy to post them -- I should have thought of it before. WARNING: I've tested these functions on some data arising in my work and also on the USArrests data that comes with
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
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
2010 Sep 08
1
saving heatmaps in graphical format that can be edited in graphic editor tool
I generated a heatmap in R using the following commands: > mydata <- read.csv(file="Data.csv", header=TRUE, sep=",") > mydata <- mydata[rowSums(mydata[,-1]^2) >0, ] > rownames(mydata)=mydata$Name > mydata <- mydata[,2:253] > mydatamatrix <- data.matrix(mydata) > mydatascale <- t(scale(t(mydatamatrix))) > hr <-