Learn R Programming

ptm (version 0.2.2)

pairwise.dist: Compute Euclidean Distances

Description

Computes the pairwise distance matrix between two sets of points

Usage

pairwise.dist(a, b, squared = TRUE)

Arguments

a, b

matrices (NxD) and (MxD), respectively, where each row represents a D-dimensional point.

squared

return containing squared Euclidean distance

Value

Euclidean distance matrix (NxM). An attribute "squared" set to the value of param squared is provided.

See Also

res.dist(), dist2closest(), ball()

Examples

Run this code
# NOT RUN {
pairwise.dist(matrix(1:9, ncol = 3), matrix(9:1, ncol = 3))
# }

Run the code above in your browser using DataLab