" proxy " is a common library for measuring distance and similarity. The following methods are supported:
"Jacquard" "Kulchinsky1" "Kulchinsky2" "Mountford" "Fager" "Russell" "Simple juxtaposition" "Hamman" "Faith"
“Tanimoto” “Cubes” “Fi” “Styles” “Michael” “Moseley” “Yule” “Yule2” “Ochayay”
"Simpson" "Brown Blanket" "cosine" "eJaccard" "fJaccard" "correlation" "Chi-square" "Phi-square" "Scuba"
"Kramer" "Pearson" "Gower" "Euclid" "Mahalanobis" "Bhuttacharya" "Manhattan" "Supremum" "Minkowski"
“Canberra” “Wave” “divergence” “Kulbek” “Bray” “Soergel” “Levenshtein” “Tribute” “Accord”
"Geodesic" "Whittaker" "Hellinger"
See the following example:
x <- c(1,2,3,4,5) y <- c(4,5,6,7,8) l <- list(x, y) simil(l, method="cosine")
The output is a similarity matrix between the "l" elements:
1 2 0.978232
The only problem I am facing is that for some methods (such as: "Jaccard") the following error occurs:
simil(l, method="Jaccard") Error in n - d : 'n' is missing
source share