sim2dist {sarp.snowprofile.alignment} | R Documentation |
Convert 'similarity' matrix to 'distance' matrix
Description
Convert a 'similarity' matrix to 'distance' matrix. Note that the similarity must be normalized (i.e. within [0, 1])
Usage
sim2dist(SimMat)
Arguments
SimMat |
similarity matrix of type data.frame with ranges [0, 1] |
Value
copy of input data.frame with similarities inverted to distances (i.e. dist = 1 - sim)
Author(s)
fherla
Examples
## the 'swissSimilarityMatrix' as similarity and as distance
graphics::image(as.matrix(swissSimilarityMatrix))
graphics::image(as.matrix(sim2dist(swissSimilarityMatrix)))
[Package sarp.snowprofile.alignment version 1.2.2 Index]