textDist_sparse: Calculate Text Distance (sparse version)
Description
When two vectors are given, this calculates the text distance between them;
text distance is calculated as the proportion of unmatched frequencies, i.e.,
the number of unmatched frequencies divided by the total frequencies among
the two vectors. However, if neither vector has any values
at all, their distance equals the number provided in the zeroes argument,
which is .5 by default. When two matrices are given, the text distance
between corresponding columns is calculated.
Usage
textDist_sparse(xi, xx, yi, yx, zeroes = 0.5)
Value
the text distance between the vectors x and y.
Arguments
xi
An integer vector with the row ids of the vector x
xx
A numeric vector with the values of the nonzero elements of x
yi
An integer vector with the row ids of the vector y
yx
A numeric vector with the values of the nonzero elements of y
zeroes
Text distance when both vectors are zero vectors; default is .5