Learn R Programming

ribiosUtils (version 1.5-6)

jaccardIndex: Calculate the Jaccard Index between two vectors

Description

Calculate the Jaccard Index between two vectors

Usage

jaccardIndex(x, y)

jaccardDistance(x, y)

Arguments

x

A vector

y

A vector

Value

The Jaccard Index, a number between 0 and 1

JaccardDistance is defined as 1-JaccardIndex.

Examples

Run this code
# NOT RUN {
myX <- 1:6
myY <- 4:9
jaccardIndex(myX, myY)
jaccardDistance(myX, myY)

myX <- LETTERS[1:5]
myY <- LETTERS[6:10]
jaccardIndex(myX, myY)
jaccardDistance(myX, myY)

# }

Run the code above in your browser using DataLab