Skip to contents

Given a dataframe of numerical variables, return a euclidean distance matrix.

Usage

get_dist_matrix(
  df,
  input_type,
  cont_dist_fn,
  disc_dist_fn,
  ord_dist_fn,
  cat_dist_fn,
  mix_dist_fn,
  weights_row
)

Arguments

df

Raw dataframe with subject IDs in column "subjectkey"

input_type

Either "numeric" (resulting in euclidean distances), "categorical" (resulting in binary distances), or "mixed" (resulting in gower distances)

cont_dist_fn

distance metric function for continuous data

disc_dist_fn

distance metric function for discrete data

ord_dist_fn

distance metric function for ordinal data

cat_dist_fn

distance metric function for categorical data

mix_dist_fn

distance metric function for mixed data

weights_row

Single-row dataframe where the column names contain the column names in df and the row contains the corresponding weights_row.

Value

dist_matrix Matrix of inter-observation distances