kendall_cor() calculates the Kendall correlation
coefficient between two numeric vectors. It uses the algorithm described in
Knight (1966), which is based on the number of concordant and discordant
pairs. The computational complexity of the algorithm is
\(O(n \log(n))\), which is faster than the base R
implementation in stats::cor(..., method = "kendall")
that has a computational complexity of \(O(n^2)\). For small
vectors (i.e., less than 100 observations), the time difference is
negligible. However, for larger vectors, the difference can be substantial.
By construction, the implementation drops missing values on a pairwise
basis. This is the same as using
stats::cor(..., use = "pairwise.complete.obs").