View source: R/04_comparison_metrics.R
chisqDistance | R Documentation |
Computes the chi-squared distance between each element of a pair of vectors which must be of the same length. Good for comparing color histograms if you don't want to weight by color similarity. Probably hugely redundant; alas.
chisqDistance(a, b)
a |
Numeric vector. |
b |
Numeric vector; must be the same length as a. |
Chi-squared distance, (a - b)^2/(a + b)
, between vectors a and
b. If one or both elements are NA/NaN, contribution is counted as a 0.
colordistance:::chisqDistance(rnorm(10), rnorm(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.