Heatmap.2 dendrogram generation
1
0
Entering edit mode
5.0 years ago

I used heatmap.2 in R, to create a heatmap. I used the following command :

heatmap.2(as.matrix(mat_data), density.info="none", trace="none", margins =c(12,9), col=my_palette, breaks=seq(96,100,0.5), dendrogram="both")

What is the method used by the heatmap.2 for dendrogram generation? Is it hclust()? If so, what metric (euclidean or manhattan distance) does it use for default, since I have used default parameters in the above command.

heatmap.2 R hclust • 3.1k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

ADD REPLY
1
Entering edit mode
5.0 years ago
Ram 43k

Please read the manual well. It says

... dendrograms are computed as dd <- as.dendrogram(hclustfun(distfun(X))) where X is either x or t(x).

where distful defaults to stats::dist and hclustfun defaults to stats::hclust.

ADD COMMENT
0
Entering edit mode

Iam sorry, but again what is the metric used by hclust() to find distance as we pass the function from distfun(). Is there any default metric ?

ADD REPLY
0
Entering edit mode

To get to that, you’ll either need to ask the developer or look into the source code for all instances of hclustfun being used. I’d recommend doing both - the latter approach is great as a learning method.

ADD REPLY

Login before adding your answer.

Traffic: 2539 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6