Rcpp

Seamless R and C++ Integration

https://github.com/rcppcore/rcpp

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    9 of 83 committers (10.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.0%) to scientific vocabulary

Keywords

c-plus-plus c-plus-plus-11 c-plus-plus-14 c-plus-plus-17 c-plus-plus-20 cran r r-package r-packages rcpp

Keywords from Contributors

data-manipulation grammar visualisation rmarkdown tidy-data package-creation travis-ci coverage-report coverage codecov
Last synced: 6 months ago · JSON representation

Repository

Seamless R and C++ Integration

Basic Info
  • Host: GitHub
  • Owner: RcppCore
  • License: gpl-2.0
  • Language: C++
  • Default Branch: master
  • Homepage: https://www.rcpp.org
  • Size: 31.1 MB
Statistics
  • Stars: 772
  • Watchers: 53
  • Forks: 219
  • Open Issues: 5
  • Releases: 46
Topics
c-plus-plus c-plus-plus-11 c-plus-plus-14 c-plus-plus-17 c-plus-plus-20 cran r r-package r-packages rcpp
Created over 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing Funding License

README.md

Rcpp: Seamless R and C++ Integration

CI License CRAN Dependencies Coverage Status Debian package r-universe Last Commit Downloads (monthly) Downloads (total) CRAN use CRAN indirect BioConductor use JSS Springer useR! TAS

Synopsis

The Rcpp package integrates R and C++ via R functions and a (header-only) C++ library.

All underlying R types and objects, i.e., everything a SEXP represents internally in R, are matched to corresponding C++ objects. This covers anything from vectors, matrices or lists to environments, functions and more. Each SEXP variant is automatically mapped to a dedicated C++ class. For example, numeric vectors are represented as instances of the Rcpp::NumericVector class, environments are represented as instances of Rcpp::Environment, functions are represented as Rcpp::Function, etc ... The Rcpp-introduction vignette (now published as a TAS paper; an earlier introduction was also published as a JSS paper provides a good entry point to Rcpp as do the Rcpp website, the Rcpp page and the Rcpp Gallery. Full documentation is provided by the Rcpp book.

Other highlights:

  • The conversion from C++ to R and back is driven by the templates Rcpp::wrap and Rcpp::as which are highly flexible and extensible, as documented in the Rcpp-extending vignette.

  • Rcpp also provides Rcpp modules, a framework that allows exposing C++ functions and classes to the R level. The Rcpp-modules vignette details the current set of features of Rcpp-modules.

  • Rcpp includes a concept called Rcpp sugar that brings many R functions into C++. Sugar takes advantage of lazy evaluation and expression templates to achieve great performance while exposing a syntax that is much nicer to use than the equivalent low-level loop code. The Rcpp-sugar gives an overview of the feature.

  • Rcpp attributes provide a high-level syntax for declaring C++ functions as callable from R and automatically generating the code required to invoke them. Attributes are intended to facilitate both interactive use of C++ within R sessions as well as to support R package development. Attributes are built on top of Rcpp modules and their implementation is based on previous work in the inline package. See the Rcpp-atttributes vignettes for more details.

Documentation

The package ships with ten pdf vignettes, including a recent introduction to Rcpp now published as a paper in TAS (and as a preprint in PeerJ). Also available is an earlier introduction which was published as a JSS paper.

Among the other vignettes are the Rcpp FAQ and the introduction to Rcpp Attributes. Additional documentation is available via the Rcpp book by Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details.

Performance

Rcpp follows the C++ motto of "you pay only for what you use" and imposes no run-time performance penalty: Rcpp outperforms related packages in direct comparison, see for example this repo for details.

Compile-time performance can be tuned by selecting components. But it is also worth noting that use of ccache will (strongly) dominate all such possible component choices, we have previously recommended its use.

Examples

The Rcpp Gallery showcases over one hundred fully documented and working examples. The package RcppExamples contains a few basic examples covering the core data types.

A number of examples are included, as are well over one thousand unit tests which provide additional usage examples.

An earlier version of Rcpp, containing what we now call the 'classic Rcpp API' was written during 2005 and 2006 by Dominick Samperi. This code has been factored out of Rcpp into the package RcppClassic, and it is still available for code relying on the older interface. New development should always use this Rcpp package instead.

Other usage examples are provided by packages using Rcpp. As of early July 2025, there are 3043 CRAN packages using Rcpp (corresponding to 13.6% of all packages, and 61.3% of packages containing compiled code), a further 271 BioConductor packages in its current release as well as an unknown number of GitHub, Bitbucket, R-Forge, ... repositories using Rcpp. All these packages provide usage examples for Rcpp. The package is in widespread use and has been downloaded over 100.6 million times (per the partial logs from the cloud mirrors of CRAN).

Installation

CRAN

Rcpp released on CRAN are carefully tested and curated. CRAN ensures they interoperate with all other CRAN package on all test environment. The released and tested versions are available via all mirrors of CRAN network, and can be installed from within R via

R install.packages("Rcpp")

Release Candidates

For the last several releases, we also made interim candidate releases available on the Rcpp Drat Repo. Versions from a drat repo can be installed either by just temporarily setting the drat repo as in

R install.packages("Rcpp", repos="https://RcppCore.github.io/drat")

or by setting a drat repo more permanently (as described in the documentation of the drat package).

Testing the release candidates prior to actual release help. Please run this if you can.

Source

To install from source, ensure you have a complete package development environment for R as discussed in the relevant documentation; also see questions 1.2 and 1.3 in the Rcpp-FAQ.

Less Common Versions and Platforms

If you want to run Rcpp on another (not-tested on CRAN) platform, or on releases older than the previous release, we suggest you do your due diligence and test accordingly. Rcpp is provided by an all-volunteer team with finite resources. We work hard to test Rcpp with several thousand CRAN packages using it---but we cannot test on outdated versions of R or your OS.

Support

The best place for questions is the Rcpp-devel mailing list hosted at R-forge. Note that in order to keep spam down, you must be a subscriber in order to post. One can also consult the list archives to see if your question has been asked before.

The issue tickets at the GitHub repo are the primary bug reporting interface. As with the other web resources, previous issues can be searched as well.

Authors

Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Nathan Russell, Iñaki Ucar, Doug Bates, and John Chambers

License

GPL (>= 2)

Owner

  • Name: Rcpp
  • Login: RcppCore
  • Kind: organization

GitHub Events

Total
  • Create event: 25
  • Release event: 2
  • Issues event: 51
  • Watch event: 30
  • Delete event: 18
  • Issue comment event: 228
  • Push event: 90
  • Pull request review event: 73
  • Pull request review comment event: 49
  • Pull request event: 55
  • Fork event: 10
Last Year
  • Create event: 25
  • Release event: 2
  • Issues event: 51
  • Watch event: 30
  • Delete event: 18
  • Issue comment event: 228
  • Push event: 90
  • Pull request review event: 73
  • Pull request review comment event: 49
  • Pull request event: 55
  • Fork event: 10

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 4,579
  • Total Committers: 83
  • Avg Commits per committer: 55.169
  • Development Distribution Score (DDS): 0.585
Past Year
  • Commits: 57
  • Committers: 8
  • Avg Commits per committer: 7.125
  • Development Distribution Score (DDS): 0.263
Top Committers
Name Email Commits
Dirk Eddelbuettel e****d@d****g 1,899
Romain François r****n@r****m 1,654
JJ Allaire j****e@g****m 258
Kevin Ushey k****y@g****m 209
Qiang Kou q****u@u****u 57
Douglas Bates d****s@g****m 56
Iñaki Úcar i****r@f****g 39
James Balamuta b****2@i****u 37
Daniel C. Dillon d****n@g****m 36
Kirill Müller k****r@m****g 33
John Chambers j****c@s****u 30
nathan-russell r****2@g****m 30
Lionel Henry l****y@g****m 27
Florian Plaza Oñate f****a@j****r 26
Matt M****D 12
Jim Hester j****r@g****m 12
Christian Authmann a****c@m****e 9
Artem Klevtsov a****v@g****m 8
Daniel C. Dillon d****n@k****m 7
Kirill Müller k****r@i****h 7
Kun Ren r****n@o****m 6
Joshua Nathaniel Pritikin j****n@p****m 6
Chenliang Xu l****d@g****m 6
Mattias Ellert m****t@p****e 6
Walter Somerville w****m@g****m 6
Ralf Stubner r****r@g****m 5
Yixuan Qiu y****u@c****e 5
mlysy m****y 5
Wush Wu w****8@g****m 4
Pierrick Roger p****r@i****m 4
and 53 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 130
  • Total pull requests: 137
  • Average time to close issues: 3 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 80
  • Total pull request authors: 17
  • Average comments per issue: 6.92
  • Average comments per pull request: 3.23
  • Merged pull requests: 128
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 31
  • Pull requests: 62
  • Average time to close issues: 3 days
  • Average time to close pull requests: 1 day
  • Issue authors: 20
  • Pull request authors: 8
  • Average comments per issue: 5.55
  • Average comments per pull request: 2.47
  • Merged pull requests: 56
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • eddelbuettel (28)
  • tdhock (4)
  • kevinushey (4)
  • Enchufa2 (4)
  • zhuxr11 (4)
  • klin333 (3)
  • garyzhubc (3)
  • andrjohns (2)
  • ms609 (2)
  • billdenney (2)
  • bbolker (2)
  • jeroen (2)
  • waynelapierre (2)
  • MichaelChirico (2)
  • SebKrantz (1)
Pull Request Authors
  • eddelbuettel (85)
  • kevinushey (15)
  • Enchufa2 (15)
  • mcol (3)
  • andrjohns (2)
  • tesujimath (2)
  • bbolker (2)
  • evalon32 (2)
  • gaborcsardi (2)
  • traversc (2)
  • pettyalex (1)
  • LTLA (1)
  • billdenney (1)
  • p00ya (1)
  • llaniewski (1)
Top Labels
Issue Labels
no-issue-activity (14) bug (1) altrep (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 1,114,682 last-month
  • Total docker downloads: 212,393,342
  • Total dependent packages: 3,613
    (may contain duplicates)
  • Total dependent repositories: 10,254
    (may contain duplicates)
  • Total versions: 120
  • Total maintainers: 1
cran.r-project.org: Rcpp

Seamless R and C++ Integration

  • Versions: 102
  • Dependent Packages: 3,137
  • Dependent Repositories: 10,139
  • Downloads: 1,114,682 Last month
  • Docker Downloads: 212,393,342
Rankings
Downloads: 0.0%
Dependent packages count: 0.0%
Dependent repos count: 0.0%
Forks count: 0.2%
Stargazers count: 0.5%
Average: 3.0%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: r-rcpp
  • Homepage: http://www.rcpp.org
  • License: GPL-2.0-or-later
  • Latest release: 1.0.9
    published over 3 years ago
  • Versions: 18
  • Dependent Packages: 476
  • Dependent Repositories: 115
Rankings
Dependent packages count: 0.1%
Dependent repos count: 3.2%
Average: 7.7%
Forks count: 12.2%
Stargazers count: 15.1%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • methods * imports
  • utils * imports
  • inline * suggests
  • pkgKitten >= 0.1.2 suggests
  • rbenchmark * suggests
  • tinytest * suggests
inst/tinytest/testRcppAttributePackage/DESCRIPTION cran
  • Rcpp >= 1.0.7 imports
inst/tinytest/testRcppClass/DESCRIPTION cran
  • R >= 2.15.0 depends
  • Rcpp >= 0.8.5 imports
  • methods * imports
inst/tinytest/testRcppInterfaceExporter/DESCRIPTION cran
  • R >= 3.1.0 depends
  • Rcpp * imports
inst/tinytest/testRcppInterfaceUser/DESCRIPTION cran
  • R >= 3.1.0 depends
  • Rcpp * imports
inst/tinytest/testRcppModule/DESCRIPTION cran
  • Rcpp >= 0.8.5 depends
  • methods * depends
inst/tinytest/testRcppPackage/DESCRIPTION cran
  • Rcpp * imports
docker/ci-dev/Dockerfile docker
  • rocker/drd latest build
.github/workflows/ci.yaml actions
  • actions/checkout v3 composite
.github/workflows/docker.yaml actions
  • actions/checkout v3 composite
  • docker/build-push-action v3 composite
  • docker/login-action v2 composite
  • docker/setup-buildx-action v2 composite
.github/workflows/stale.yaml actions
  • actions/stale v6 composite
docker/ci/Dockerfile docker
  • r-base latest build
docker/ci-3.4/Dockerfile docker
  • r-base 3.4.4 build
docker/ci-3.5/Dockerfile docker
  • r-base 3.5.3 build
docker/ci-3.6/Dockerfile docker
  • r-base 3.6.3 build
docker/ci-4.0/Dockerfile docker
  • r-base 4.0.5 build
docker/ci-4.1/Dockerfile docker
  • r-base 4.1.3 build
docker/plus/Dockerfile docker
  • rcpp/run latest build
docker/run/Dockerfile docker
  • rcpp/ci latest build