Learn R Programming

ribiosUtils (version 1.7.7)

jaccardIndex: Calculate the Jaccard Index between two vectors

Description

Calculate the Jaccard Index between two vectors

Usage

jaccardIndex(x, y)

jaccardDistance(x, y)

Value

The Jaccard Index, a number between 0 and 1

JaccardDistance is defined as 1-JaccardIndex.

Arguments

x

A vector

y

A vector

Examples

Run this code

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