distant.Rd
Convert a similarity matrix into a distance matrix.
distant(s, t = FALSE)
s | a similarity matrix |
---|---|
t | return the same matrix if t=FALSE |
For better resultas, use the parameter distance in sim
function.
A distance matrix.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
# From a random incidence matrix I(25X4) I <- matrix(rbinom(100, 1, .5), nrow = 25, ncol = 4, dimnames = list(NULL, c("A", "B", "C", "D"))) J <- sim(I, "Jaccard") distant(J, t = TRUE)#> A B C #> B 0.6818182 #> C 0.7000000 0.3684211 #> D 0.6111111 0.5714286 0.5000000#> A B C #> B 0.6818182 #> C 0.7000000 0.3684211 #> D 0.6111111 0.5714286 0.5000000