jaccard: Jaccard similarity index

View source: R/statistics.R

jaccardR Documentation

Jaccard similarity index

Description

Computes |A intersection B| / |A union B|. Matches the web tool's convention of returning 0 when both sets are empty (NaN-safe).

Usage

jaccard(size_a, size_b, intersection)

Arguments

size_a

Inclusive size of set A (integer >= 0).

size_b

Inclusive size of set B (integer >= 0).

intersection

Inclusive intersection size |A intersection B|.

Value

Numeric in [0, 1].

Examples

jaccard(10, 10, 5)
jaccard(0, 0, 0)

vennDiagramLab documentation built on May 19, 2026, 1:07 a.m.