How to make cut off linein cluster,
1
1
Entering edit mode
19 months ago
Info.shi ▴ 30

Hi Everyone,

I was trying to draw a cut-off line to 0.02 in the dendrogram, but I could not draw the line.

Kindly please help me.

My R code is as follows-

y=as.matrix(matrix)

hc <- hclust(as.dist(1-cor(y, method="spearman")), method="average")

sampleTree = as.dendrogram(hc, method="average")
plot(sampleTree,
     main = "Sample Clustering",
     ylab = "Height")

cut_avg <- cutree(hc, h = 0.02)

I also attach the dendogram cluster for reference.enter image description here

Thank you!

dendogram Cutoff R • 686 views
ADD COMMENT
1
Entering edit mode
19 months ago
Jeremy ▴ 930

Try adding the following line of code:

abline(h = .02)
ADD COMMENT
1
Entering edit mode

Thank you so much it worked. I highly appreciate your help.

ADD REPLY

Login before adding your answer.

Traffic: 1546 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