R/fdistColPearson.R

Defines functions f.distCol.Pearson.2

Documented in f.distCol.Pearson.2

#' 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))
}
msxakk89/dat documentation built on Aug. 3, 2020, 6:39 p.m.