All Questions

Tagged with
Filter by
Sorted by
Tagged with
31
votes
1answer
4k views

How can I produce plots like this?

I have come across this kind of a plot that performs hierarchical clustering over a given set of timeseries data. Can someone tell me how to draw such plots? I am open to implementations in R or ...
26
votes
2answers
3k views

Joining a dendrogram and a heatmap

I have a heatmap (gene expression from a set of samples): set.seed(10) mat <- matrix(rnorm(24*10,mean=1,sd=2),nrow=24,ncol=10,dimnames=list(paste("g",1:24,sep=""),paste("sample",1:10,sep=""))) ...
25
votes
2answers
25k views

How to plot dendrograms with large datasets?

I am using ape (Analysis of Phylogenetics and Evolution) package in R that has dendrogram drawing functionality. I use following commands to read the data in Newick format, and draw a dendrogram using ...
22
votes
6answers
12k views

How do you compare the “similarity” between two dendrograms (in R)?

I have two dendrograms which I wish to compare to each other in order to find out how "similar" they are. But I don't know of any method to do so (let alone a code to implement it, say, in R). Any ...
19
votes
2answers
34k views

horizontal dendrogram in R with labels

I am trying to draw a dendrogram from the hclust function output. I hope the dendrogram is horizontally arranged instead of the default, which can be obtain by (for example) require(graphics) hc <-...
19
votes
3answers
4k views

How to build a dendrogram from a directory tree?

Given a root absolute directory path. How do I generate a dendrogram object of all path's below it so that I can visualize the directory tree with R? Suppose the following call returned the following ...
16
votes
2answers
33k views

Label and color leaf dendrogram

I am trying to create a dendrogram, were my samples have 5 group codes (act as sample name/species/etc but its repetitive). Therefore, I have two issues that a help will be great: How can I show ...
15
votes
2answers
6k views

how to convert a data.frame to tree structure object such as dendrogram

I have a data.frame object. For a simple example: > data.frame(x=c('A','A','B','B','B'), y=c('Ab','Ac','Ba', 'Ba','Bd'), z=c('Abb','Acc','Bad', 'Bae','Bdd')) x y z 1 A Ab Abb 2 A Ac Acc 3 B ...
14
votes
2answers
13k views

How do I manually create a dendrogram (or “hclust”) object ? (in R)

I have a dendrogram given to me as images. Since it is not very large, I can construct it "by hand" into an R object. So my question is how do I manually create a dendrogram (or "hclust") object when ...
13
votes
1answer
6k views

Labelling ggdendro leaves in multiple colors

I have a situation in which i am plotting a dendrogram with data points that come with class labels. I wish to see that agglomerative clustering groups those with the same label together. Color ...
13
votes
3answers
7k views

Extract labels membership / classification from a cut dendrogram in R (i.e.: a cutree function for dendrogram)

I'm trying to extract a classification from a dendrogram in R that I've cut at a certain height. This is easy to do with cutree on an hclustobject, but I can't figure out how to do it on a dendrogram ...
10
votes
3answers
15k views

How to create a dendrogram with colored branches?

I would like to create a dendrogram in R which has colored branches, like the one shown below. So far I used following commands to create a standard dendrogram: d <- dist(as.matrix(data[,29])) ...
10
votes
2answers
1k views

Plotting tanglegrams subplots in R using dendextend

I am plotting Tanglegrams in R using dendextend. I am wondering if it is possible to plot multiple subplots using par(mfrow = c(2,2))? I can't seem to figure it out. Thanks library(dendextend) ...
9
votes
2answers
2k views

Duelling dendrograms in r (Placing dendrograms back to back in r)

Is there any fairly straight forward way of placing two dendrogram 'back to back' in r? The two dendrograms contain the same objects but are clustered in slightly different ways. I need to emphasise ...
8
votes
3answers
10k views

Tree cut and Rectangles around clusters for a horizontal dendrogram in R

I am trying to plot the results of a hierarchical clustering in R as a dendrogram, with rectangles identifying clusters. The following code does the trick for a vertical dendrogram, but for a ...

15 30 50 per page
1
2 3 4 5
20