This function computes pairwise Jaccard Similarities for all pairs of character vectors provided. Flexibility on input allows for three use cases: (1) In the simplest use case, two character vectors are provided to x and y arguments. (2) Alternatively, a single list of character vectors can be passed to x, in which case Jaccard similarities will be computed for all pairs of vectors in the list. (3) Lastly, two (different) lists of character vectors are provided to x and y arguments, respectively, in which case Jacccard similarities will be computed for all inter-list pairs of vectors.

Jaccard(x, y = NULL, cutoff = 0, row = T, col = F)

Arguments

x

character vector or list of character vectors

y

optional character vector or list of character vectors. If x is a character vector, y must be provided. Default: NULL

cutoff

remove rows/columns below the specified value. Default: 0

row

boolean indicating whether to filter rows if cutoff is specified. Default: TRUE

col

boolean indicating whether to filter cols if cutoff is specified. Default: FALSE

Value

numeric Jaccard value between x and y if both are character vectors or a mrix of Jaccard values between all pairs of character vectors amongst x if x is a list and y was not provided, or between x and y if y was provided. If x and y were provided, the elements in x correspond to the columns in the output matrix.