# Prepares data and distance matrices for metric calculation

Source:`R/metric-helpers.R`

`prep_data_dist.Rd`

Prepares data and distance matrices for metric calculation

## Usage

`prep_data_dist(object, new_data = NULL, dists = NULL, dist_fun = Rfast::Dist)`

## Arguments

- object
A fitted cluster_spec object.

- new_data
A dataset to calculate predictions on. If

`NULL`

, the trained cluster assignments from the fitted object are used.- dists
A distance matrix for the data. If

`NULL`

, distance is computed on`new_data`

using the`stats::dist()`

function.- dist_fun
A custom distance functions.