Efficient Implementation of Kendall's Correlation Coefficient Computation
Overview
The computational complexity of the implemented algorithm for Kendall's correlation is O(n log(n)), which is faster than the base R implementation with 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 speed difference can be substantial and the numerical difference is minimal. The references are Knight (1966) doi:10.2307/2282833, Abrevaya (1999) doi:10.1016/S0165-1765(98)00255-9, Christensen (2005) doi:10.1007/BF02736122 and Emara (2024) https://learningcpp.org/. This implementation is described in Vargas Sepulveda (2025) doi:10.1371/journal.pone.0326090.
- Using 'cpp4r' instead of 'cpp11' for a slight speed improvement.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 3includes a package overview page
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 67%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 16
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
12 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/pachadotdev/kendallknight on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows
The repository owner accepts GitHub Sponsors
Show all practicesHide 3 practices
Dependencies
Installing kendallknight adds 1 package (0 with compiled code, 203 KB of source tarballs). Heaviest: cpp4r 203 KB.
Code & Tests
People & History
Package metadata
- First published
- 2024-11-21
- Total releases
- 6 / 2 yrs
- License
- Apache License (>= 2)
- Minimum R
- ≥ 3.5.0
- Download size
- 25 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("kendallknight")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1371/journal.pone.0326090.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.