identity_distance: Identity distance between two vectors

identity_distR Documentation

Identity distance between two vectors

Description

Identity distance ('identity_dist') between two vectors is defined as: d = (x - y)/sqrt(2). The 'identity_dist_matrix' function performs this calculation for every pairwise rows in a matrix.

Usage

identity_dist(x, y, iqr = FALSE)

identity_dist_matrix(matrix)

calcIdenDist(matrix)

identityDist(x, y, iqr = FALSE)

Arguments

x

a numeric vector

y

a numeric vector

iqr

logical, default to FALSE. If set to TRUE, then IQR of the identity distance is returned.

matrix

a matrix

Examples

set.seed(1)
x = rnorm(100)
identity_dist(x = x, y = 3*x, iqr = FALSE)
identity_dist(x = x, y = 3*x, iqr = TRUE)
set.seed(1)
x = matrix(rnorm(100), ncol = 20)
identity_dist_matrix(x)

kevinwang09/top documentation built on April 20, 2022, 3:01 a.m.