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.

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)
#> [1] 0.839935
identity_dist(x = x, y = 3*x, iqr = TRUE)
#>       id    iqr_d 
#> 0.839935 1.676957 
set.seed(1)
x = matrix(rnorm(100), ncol = 20)
identity_dist_matrix(x)
#>           1         2         3         4
#> 2 0.7361722                              
#> 3 0.7497176 0.5937238                    
#> 4 0.9920202 0.4280521 0.6623757          
#> 5 0.7307259 0.4646133 0.6122022 0.6302837