distant: Distance matrix.

Description Usage Arguments Details Value Author(s) Examples

View source: R/netcoin.R

Description

Convert a similarity matrix into a distance matrix.

Usage

1
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

1
2
3
4
5
6
7
# 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)

netCoin documentation built on Oct. 29, 2021, 1:06 a.m.