getSimilarity: Measures of patient similarity

Description Usage Arguments Value Examples

View source: R/getSimilarity.R

Description

Measures of patient similarity

Usage

1
getSimilarity(x, type = "pearson", customFunc, ...)

Arguments

x

(matrix) matrix for which pairwise patient similarity is to be computed. Expects one column per patient, and one measurement per row.

type

(character) name of similarity measure. Currently supports Pearson correlation ('pearson') or a custom measure ('custom')

customFunc

(function) custom similarity function. Only used when type='custom'. The function takes x as first argument and can take additional argument. It should return a symmetric matrix of pairwise patient similarities.

...

parameter for customFunc

Value

symmetric matrix of size N, where N is number of samples

Examples

1
2
3
4
data(xpr) 
x <- getSimilarity(xpr) # similarity by Pearson corr
mySim <- function(x) cor(x,method='kendall')
x <- getSimilarity(xpr,customFunc=mySim) # custom similarity

BaderLab/netDx documentation built on Sept. 26, 2021, 9:13 a.m.