Learn R Programming

orthoDr (version 0.6.8)

dist_cross: Cross distance matrix

Description

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.

Usage

dist_cross(x1, x2)

Value

A distance matrix with its (i, j)th element being the Gaussian kernel distance between ith row of X1 jth row of X2.

Arguments

x1

First data matrix

x2

Second data matrix

Examples

Run this code
# two matrices
set.seed(1)
x1 <- matrix(rnorm(10), 5, 2)
x2 <- matrix(rnorm(6), 3, 2)
dist_cross(x1, x2)

Run the code above in your browser using DataLab