pair_dist: Calculate a weighted distance (between two vectors) based on...

View source: R/pair_dist.R

pair_distR Documentation

Calculate a weighted distance (between two vectors) based on Jaccard's coefficient

Description

Calculate a weighted distance (between two vectors) based on Jaccard's coefficient

Usage

pair_dist(x, y, weights)

Arguments

x

a vector of discrete values

y

a vector of discrete values

weights

a vector of non-negative alteration values

Value

a weighted distance based on Jaccard's coefficient. Ratio of the size of intersection to the size of the union of two sets after discarding 0-0 matches from the two vectors

Author(s)

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

Examples

n <- 100
x <- sample(c(0, 1), n, replace=TRUE)
y <- sample(c(0, 1), n, replace=TRUE)
weights <- rnorm(n)
pair_dist(x, y, weights)


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