powered by
Computes the Jaccard similarity between x and y. When both x and y only contain zeroes, the Jaccard similarity it not defined. This function returns zero for that specific case.
jaccard(x, y)
A vector of zeroes and ones.
The Jaccard similarity between x and y.
# NOT RUN { set.seed(2) n = 100 x = rbinom(n, 1, 0.5) y = rbinom(n, 1, 0.5) jaccard(x, y) # }
Run the code above in your browser using DataLab