Skip to contents

Creates a configuration object for computing Euclidean dissimilarity. Pass the result to dissimilarity() to compute the dissimilarity matrix.

The scaled Euclidean dissimilarity between two observations \(x_i\) and \(x_j\) is:

\[d(x_i, x_j) = \sqrt{\frac{1}{p} \sum_{k=1}^{p}(x_{i,k} - x_{j,k})^2}\]

where \(p\) is the number of variables. Results are equivalent to stats::dist() but scaled by \(1/p\).

Usage

diss_euclidean(center = TRUE, scale = FALSE)

Arguments

center

Logical. Center the data before computing distances? Applied jointly to Xr and Xu if both are provided. Default TRUE.

scale

Logical. Scale the data before computing distances? Applied jointly to Xr and Xu if both are provided. Default FALSE.

Value

An object of class c("diss_euclidean", "diss_method").

Examples

m <- diss_euclidean()
m <- diss_euclidean(center = FALSE, scale = TRUE)