calc_weighted_corr: Calculate weighted correlation

View source: R/calc_weighted_corr.R

calc_weighted_corrR Documentation

Calculate weighted correlation

Description

Calculate weighted correlation

Usage

calc_weighted_corr(a, b, w = rep(1, nrow(a))/nrow(a))

Arguments

a

numeric matrix

b

numeric matrix

w

alteration weights

Value

a weighted correlation (similarity) matrix

Author(s)

Rileen Sinha (rileen@gmail.com), Augustin Luna (aluna@jimmy.harvard.edu)

Examples

t1 <- as.matrix(c(1,1,1,1,1,1,2,2,2,3,3,3,4,4))
t2 <- as.matrix(rev(t1))
weight <- c(.5,.5,.5,.5,.5,1,1,1,1,2,2,2,2,2)
calc_weighted_corr(t1, t2, weight)


cannin/tumorcomparer documentation built on Feb. 7, 2023, 3:13 p.m.