pairDist: Calculate pairwise distances between two matrices or data...

Description Usage Arguments Value See Also Examples

View source: R/pairDist.r

Description

This function takes two data frames or matrices and returns a matrix of pairwise Euclidean distances between the two.

Usage

1
pairDist(set1, set2, na.rm = FALSE)

Arguments

set1

Data frame or matrix one or more columns wide.

set2

Data frame or matrix one or more columns wide.

na.rm

Logical, if TRUE then any rows in set1 or set2 with at least one NA are removed first.

Value

Matrix with nrow(set1) rows and nrow(set2) columns. Values are the distance between each row of set1 and row of set2.

See Also

dist

Examples

1
2
3
set1 <- data.frame(x1=1:20, x2=round(100 * rnorm(20)))
set2 <- data.frame(x1=sample(1:30, 30), x2=sort(round(100 * rnorm(30))))
pairDist(set1, set2)

adamlilith/omnibus documentation built on Nov. 21, 2018, 11:01 a.m.