Converts distance objects into similarity objects.

dist2sim(dist, transform, k = 1, normalise = TRUE, max_d)

Arguments

dist

object of class distance

transform

object of class character, can be either "linear" or "exponential"

k

scaling parameter

normalise

object of class logical, which when TRUE will normalise distances to one

max_d

object of class numeric

Value

dist2sim(x) returns an object of class similarity.

Details

Distances can be transformed either *linearly* or *exponentially*. That is 1 - k * dist for non-negative values, or exp(-k * dist), respectively. If normalise is true, then dist = dist/max_d.