#' Distance by correlation matrix for hierarchical clustering in heatmaps
#'
#' Compute a matrix of distances based on Pearson's correlation.
#'
#' Distance is defined as dist = 1 - correlation coeficient.
#' Note that it transposes the input matrix in order to be able to use it for hierarchical clustering in heat map creation.
#'
#' @param x A matrix of expression values
#' @param method Defults to "pearson". Can also be "kendall", "spearman".
#' @return Pearson correlation based distance object
#' @export
f.distCol.Pearson.2 <- function(x, method = "pearson"){
as.dist(1 - cor(x, method = method))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.