getSimilarity {netDx}R Documentation

Measures of patient similarity

Description

Measures of patient similarity

Usage

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

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

[Package netDx version 1.0.3 Index]