Create a Distance Function Object
create_dist.RdConstructs a generic distance function object, storing:
name: The name (method) of the distance (e.g., "euclidean", "cordist", "mahalanobis").labels: (Optional) a vector of labels associated with the data rows....: Additional parameters relevant to the specific distance method (e.g., correlation method forcordist, number of components forpcadist, etc.).
Arguments
- name
A character string specifying the distance method (e.g., "euclidean", "cordist").
- labels
A vector of row labels (optional), primarily for informational/reference purposes.
- ...
Additional parameters for the distance method (e.g. `method="pearson"` for correlation, or
whiten=TRUEfor PCA-based distances).
Details
This object is used by pairwise_dist() to compute an N x N matrix of pairwise distances
between rows of a data matrix.
The distance function object itself does not exclude same-block comparisons or reorder rows by label.
Those tasks (if needed) are handled downstream (for example, in second_order_similarity).