distant {netCoin} | R Documentation |
Distance matrix.
Description
Convert a similarity matrix into a distance matrix.
Usage
distant(s, t = FALSE)
Arguments
s |
a similarity matrix |
t |
return the same matrix if t=FALSE |
Details
For better resultas, use the parameter distance in sim
function.
Value
A distance matrix.
Author(s)
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
Examples
# 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)
#Same results
sim(I, "Jaccard", distance = TRUE)
[Package netCoin version 2.0.48 Index]