pairwise_euclidean: Pairwise Euclidean Distance

View source: R/pairwise_euclidean.R

pairwise_euclideanR Documentation

Pairwise Euclidean Distance

Description

Calculates the pairwise Euclidean distance.

Usage

pairwise_euclidean(data, cols, case_weights, norm = FALSE)

Arguments

data

A data frame.

cols

Columns to analyze.

case_weights

An optional column of case weights.

norm

Whether or not to normalize the distance, default is FALSE.

Details

  • Metric: Distance

  • Symmetrical: Yes

  • Upper Limit: Inf (1 when normalized)

  • Lower Limit: 0

B
1 0
A 1 a b
0 c d

Euclidean = sqrt(b+c)
Normalized = sqrt((b+c)/N)

Value

A matrix.

Examples

res <- pairwise_hamming(
    data = FoodSample,
    cols = Bisque:Turkey
)

print(res)

tidy(res)


ttrodrigz/onezero documentation built on May 9, 2023, 2:59 p.m.