dist_cross {orthoDr} | R Documentation |
Calculate the Gaussian kernel distance between rows of X1 and rows of X2.
As a result, this is an extension to the stats::dist()
function.
dist_cross(x1, x2)
x1 |
First data matrix |
x2 |
Second data matrix |
A distance matrix with its (i, j)th element being the Gaussian kernel
distance between ith row of X1
jth row of X2
.
# two matrices
set.seed(1)
x1 <- matrix(rnorm(10), 5, 2)
x2 <- matrix(rnorm(6), 3, 2)
dist_cross(x1, x2)