Computes the Jaccard dissimilarity between two matrices.
jaccard_dissimilarity(A, B)
Arguments
- A
A numeric matrix of size N x p (N observations, p species).
- B
A numeric matrix of size M x p (M observations, p species).
Value
A dissimilarity matrix of size N x M.
Examples
A <- matrix(c(1, 0, 1, 0, 1, 1), nrow = 2, ncol = 3)
B <- matrix(c(0, 1, 1, 1, 0, 1), nrow = 2, ncol = 3)
jaccard_dissimilarity(A, B)
#> [,1] [,2]
#> [1,] 0.6666667 0.0000000
#> [2,] 1.0000000 0.6666667