#' plot dendrogram
#'
#' @param m (matrix)
#' @param distFun (function) if NULL, uses
#' @param linkageMethod (char) for hclust
#' @param circ (logical) make circular
#' @param ... for plot() method
#' @import ape
#' @export
plotDendro <- function(m,distFun=function(x){1-cor(x)},
linkageMethod="average",circ=FALSE,...) {
d <- as.dist(distFun(m))
h <- hclust(d,method=linkageMethod)
if (circ) {
plot(as.phylo(h),type="fan",...)
} else {
plot(h,...)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.