'Rcpp' Bindings for 'Redis' using the 'hiredis' Library

Connection to the 'Redis' key/value store using the C-language client library 'hiredis' (included as a fallback) with 'MsgPack' encoding provided via 'RcppMsgPack' headers.

RcppRedis is a Rcpp and hiredis-based Redis client for R


The package has three dependencies that should be easily resolvable:

  • hiredis, the main C library for Redis, eg via libhiredis-dev on Debian or Ubuntu; as a fallback hiredis is also included
  • Rcpp for seamless R and C++ integration (on CRAN)
  • RApiSerialize for C-level serialization from the R API (on CRAN) , and if so, of sufficient vintage80

The package should install from source like any other R package. If the a hiredis library is found, it will be used. The pkg-config script is used to find the hiredis headers and library. Otherwise the embedded hiredis is used. All of Rcpp, RApiSerialized and RcppRedis can be installed directly from CRAN (which is the recommended approach) or GitHub.

MessagePack support is optional, and provided by RcppMsgPack package on CRAN which, if installed, is used to provide MessagePack headers for MessagePack serialization.

Getting Started

Run some of the scripts from the demo/ directory.


The package works well, is used in production, and has been on CRAN for some time.

It is however only providing a subset of the Redis API.


This package was derived from an initial fork of an earlier attempt named 'rhiredis' by Wush Wu, and has since been extended in a number of ways. William Pleasant provided some early patches. Whit Armstrong and Russell Pierce contributed extensions.


Dirk Eddelbuettel, based on earlier work by Wush Wu and with contributions by William Pleasant, Russell Pierce and Whit Armstrong.


GPL (>= 2)


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.11 by Dirk Eddelbuettel, 5 months ago

https://github.com/eddelbuettel/rcppredis, https://dirk.eddelbuettel.com/code/rcpp.redis.html

Report a bug at https://github.com/eddelbuettel/rcppredis/issues

Browse source code at https://github.com/cran/RcppRedis

Authors: Dirk Eddelbuettel

Documentation:   PDF Manual  

Task views: Databases with R

GPL (>= 2) license

Imports methods, Rcpp, RApiSerialize

Suggests RcppMsgPack, rredis, tinytest

Linking to Rcpp, RApiSerialize, BH

System requirements: An available hiredis library (eg via package libhiredis-dev on Debian/Ubuntu, hiredis-devel on Fedora/RedHat, or directly from source from <https://github.com/redis/hiredis>) is preferred but otherwise built on demand.

See at CRAN