RoCoCo - An R Package Implementing a Robust Rank Correlation Coefficient and a Corresponding Test

Classical rank correlation measures are designed for ordinal data, but they are not ideally suited for measuring rank correlation for numerical data that are perturbed by noise. We introduced a family of robust rank correlation measures on the basis of Goodman's and Kruskal's gamma, where the classical ordering of real numbers is replaced by some fuzzy ordering with smooth transitions - thereby ensuring that the correlation measure is continuous with respect to the data. The present R package implements this rank correlation measure along with a corresponding statistical test. Moreover, the package also implements the Gaussian rank correlation estimator and a corresponding statistical test.


The package is available through CRAN - The Comprehensive R Archive Network (click here to view the archive entry of the package). Therefore, the simplest way to install the package is to enter
into your R session. If, for what reason ever, you prefer to install the package manually, follow the instructions in the user manual.

The current version of the package is 1.1.5 (released 2017-07-02).

Getting started

  1. To load the package, enter "library(rococo)" in your R session.
  2. To view the user manual, enter "vignette("rococo")".
  3. To do a first example, enter "example(rococo)".


  1. User Manual: PDF (165KB; last updated on 2017-07-02)
  2. Reference Manual: PDF (100KB; last updated on 2017-07-02; generated automatically from package help pages)

User support

If you encounter any issues or if you have any question that might be of interest also for other users, before writing a private message to the package developers/maintainers, please consider posting to the R-help Mailing List or on StackOverflow.

Citing this package

If you use this package for research that is published later, you are kindly asked to cite it as follows:

U. Bodenhofer, M. Krone, and F. Klawonn (2012). Testing noisy numerical data for monotonic association. Inform. Sci., DOI: 10.1016/j.ins.2012.11.026.

U. Bodenhofer and F. Klawonn (2008). Robust rank correlation coefficients on the basis of fuzzy orderings: initial steps. Mathware Soft Comput. 15(1):5-20.

Change log

Version 1.1.5, released 2017-07-02:
  • registered C/C++ subroutines
  • cleanup and streamlining of C++ code
Version 1.1.4, released 2016-10-07:
  • added special options for dealing with cases in which observables do not show any variation
  • fixed automatic computation of tolerances for cases where IQR is 0
Version 1.1.3, released 2016-04-19:
  • vignette engine changed from Sweave to knitr
  • fix of on-demand loading of compiler package
  • random number generation in compiled code switched to R API
  • moved NEWS to inst/NEWS
  • namespace fixes
Version 1.1.2, released 2014-06-30:
  • updated citation
  • adapted dependency and linking to Rcpp version 0.11.1 (to avoid issues on Mac OS)
  • minor correction of package namespace
  • improvements of consistency of error and warning messages
  • adaptations of help pages and package vignette
Version 1.1.1, released 2014-02-27:
  • adapted dependencies and linking to Rcpp version 0.11.0
  • cleared up package dependencies
Version 1.1.0, released 2013-01-10:
  • estimation of p-values now based on relative frequencies
  • Gaussian rank correlation estimator and test added
  • corresponding adaptations of man pages and vignette
  • updated citation
  • moved vignette to vignettes according to the new guidelines
Version 1.0.1, released 2011-10-24:
  • improved estimation of p-values
  • added exact computation of p-values (only for 10 or less samples)
Version 1.0.0, released 2011-10-03:
first public release


For suggestions, bug reports, and other matters regarding the package, please contact