dist2sim: Distance to similarity

View source: R/dist2sim.R

dist2simR Documentation

Distance to similarity

Description

Converts distance objects into similarity objects.

Usage

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

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.

Value

dist2sim(x) returns an object of class similarity.


boydorr/rdiversity documentation built on May 6, 2022, 10:56 a.m.