Displaying 20 results from an estimated 8000 matches similar to: "Re: Clustering in R"
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")
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
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")
2002 Apr 29
2
cluster analyses
I'm clustering rather large data sets and would like to cut the dendrograms
to get a better view of specific components. I calculate the dissimilarity
matrix using daisy() because I have a mixture of variable types: factors,
ordered factors and numerical variables. If I want one dendrogram, I use
agnes() for the agglomerative nesting and pltree() to draw the dendrogram.
That way, I get the
2004 Dec 15
1
hclust and heatmap - slightly different dendrograms?
Good afternoon,
I ran heatmap and hclust on the same matrix x (strictly, I ran
heatmap(x), and hclust(dist(t(x))), and realized that the two
dendrograms were slightly different, in that the left-right
arrangement of one pair of subclusters (columns) was reversed in the
two functions (but all individual columns were grouped correctly).
Looking through the code for heatmap as a most definite
2012 Feb 23
2
Advice on exploration of sub-clusters in hierarchical dendrogram
Dear R user,
I am a biochemist/bioinformatician, at the moment working on protein
clusterings by conformation similarity.
I only started seriously working with R about a couple of months ago.
I have been able so far to read my way through tutorials and set-up my
hierarchical clusterings. My problem is that I cannot find a way to obtain
information on the rooting of specific nodes, i.e. of
2002 Mar 05
1
no labels when plotting dendrograms
I'd like to be able to cut dendrograms at a height I specify
and then plot the resulting subtrees. I wanted to use the
dendrogram object for this purpose because there doesn't seem
to be a canned way to cut a hclust object and get a list of
hclust objects, but there is a function (cut) that does that
for dendrograms. The problem I'm having is that when I plot
a dendrogram, I
2011 Jul 01
1
highlighting clusters in a heatmap
I would like to draw horizontal or vertical lines on a heatmap to
highlight the clusters at some specified cut depth of the dendrogram.
As a hacked example, the following code would work if I could set the
coordinates of the top and bottom of the false color image correctly
(ymin and ymax), but the correct values seem to depend on the output
device and its size. I realize that heatmaps use a 2x2
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
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 <-
2010 Sep 08
2
saving heatmaps in graphical format that can be edited in graphic editor tools
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 <-
2013 Apr 23
1
assigning cluster id in cluster package-reg.
Well, you don't give much of an example....
I'm replying CC to the R mailing list. Please ask questions there, rather
than adressing individuals for basic help.
Here is one; does it answer your question ?
data(agriculture)
ag.ag <- agnes(agriculture)
class(ag.ag)
pltree(ag.ag) # the dendrogram, if you want to see it
## cut the dendrogram -> get cluster assignments:
(ck3 <-
2004 Jan 04
5
Analyzing dendograms??
I have used heatmap to visualize my microarray data. I have a matrix of
M-values. I do the following.
#The distance between the columns.
sampdist <- dist(t(matrix[,]), method="euclidean")
sclus <- hclust(sampdist, method="average")
#The distance between the rows.
genedist <- dist(matrix[,], method="euclidean")
gclus <- hclust(genedist,
2006 Mar 09
1
Identifying or searching for labels in a hclust/dendrogram/heatmap
Hi
Sorry if this is in the help :-S
I've looked at example(dendrogram) and though it gives some indication of what I want, it doesn't do all.
OK, so here is what I want to do: draw a tree, and then have an action, on user-click, to either draw a sub tree or a plot of the data. I also want users to be able to search for a particular label and have it highlighted on the tree, say in
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
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)
2010 Sep 17
1
Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function
Hello R-Helpers,
I have a question about extracting the clusters of genes after we make the
heatmap (say ht4) using the heatmap.2 function. Basically, I want to get the
clusters which are shown as row dendrogram in the heatmap.
I understand that ht4$rowDendrogram is an object of dendrogram and it
containes details of all the nodes and branches, but lets say I want to know
the number of clusters
2002 Jul 19
2
Plotting a section of a dendrogram
> I have performed clustering analysis with hclust (Ward's method) on a
> database of 800 samples. As you may imagine the full dendrogram is not
> really readable. I have obtained groups with cutree. I would like to
plot
> sub-sections of my big dendrogram to show group 1, group 2 and so on.
I don't think R has anything like subtree in Splus, unfortunately. I
think what has