powered by
Convert a 'similarity' matrix to 'distance' matrix. Note that the similarity must be normalized (i.e. within [0, 1])
sim2dist(SimMat)
similarity matrix of type data.frame with ranges [0, 1]
copy of input data.frame with similarities inverted to distances (i.e. dist = 1 - sim)
# NOT RUN { ## the 'swissSimilarityMatrix' as similarity and as distance graphics::image(as.matrix(swissSimilarityMatrix)) graphics::image(as.matrix(sim2dist(swissSimilarityMatrix))) # }
Run the code above in your browser using DataLab