Hi there! I am using aheatmap to find some pattern but I need to reorder the dendrogram. I find there is a function called reorder that seems to do this job but I am really having difficulty in understanding it. I tried messing around with 'weights' for reorder, I thought when the anglo.fun = mean it will ignore the size of each cluster than I could just give each cluster a vector of the same number but actually it is NOT!
I tried looking other pages like, https://email@example.com/msg195536.html. and there is an example on the man page.
set.seed(123) x <- rnorm(10) hc <- hclust(dist(x)) dd <- as.dendrogram(hc) dd.reorder <- reorder(dd, 10:1) plot(dd, main = "random dendrogram 'dd'") > op <- par(mfcol = 1:2) plot(dd.reorder, main = "reorder(dd, 10:1)") plot(reorder(dd, 10:1, agglo.FUN = mean), main = "reorder(dd, 10:1, mean)") par(op)
Have no idea about how this function works! Really need help.