Movatterモバイル変換


[0]ホーム

URL:


Rcpp: Seamless R and C++Integration

CILicenseCRANDependenciesCoverage StatusDebian packager-universeLast CommitDownloads (monthly)Downloads (total)CRAN useCRAN indirectBioConductor useJSSSpringer useR!TAS

Synopsis

TheRcpppackage integrates R and C++ via R functions and a (header-only) C++library.

All underlying R types and objects,i.e., everything aSEXP represents internally in R, are matched tocorresponding C++ objects. This covers anything from vectors, matricesor lists to environments, functions and more. EachSEXPvariant is automatically mapped to a dedicated C++ class. For example,numeric vectors are represented as instances of theRcpp::NumericVector class, environments are represented asinstances ofRcpp::Environment, functions are representedasRcpp::Function, etc … TheRcpp-introductionvignette (now published as aTAS paper; anearlierintroduction was also published as aJSS paper provides agood entry point to Rcpp as do theRcppwebsite, theRcpp page andtheRcpp Gallery. Fulldocumentation is provided by theRcppbook.

Other highlights:

Documentation

The package ships with ten pdf vignettes, including arecentintroduction to Rcpp now published as apaper in TAS(and as apreprint inPeerJ). Also available is anearlierintroduction which was published as aJSS paper.

Among the other vignettes are theRcppFAQ and the introduction toRcppAttributes. Additional documentation is available via theRcppbook by Eddelbuettel (2013, Springer); see ‘citation(“Rcpp”)’ fordetails.

Performance

Rcpp follows the C++ motto of“you pay only for what youuse” and imposes norun-time performance penalty: Rcppoutperforms related packages in direct comparison, see for examplethis repo fordetails.

Compile-time performance can be tuned by selecting components. But itis also worth noting that use ofccache will (strongly)dominate all such possible component choices, we havepreviouslyrecommended its use.

Examples

TheRcpp Gallery showcasesover one hundred fully documented and working examples. ThepackageRcppExamples contains a few basic examples covering the core datatypes.

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

An earlier version of Rcpp, containing what we now call the ‘classicRcpp API’ was written during 2005 and 2006 by Dominick Samperi. Thiscode has been factored out of Rcpp into the package RcppClassic, and itis still available for code relying on the older interface. Newdevelopment should always use this Rcpp package instead.

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

Installation

CRAN

Rcpp released on CRAN are carefully tested and curated. CRAN ensuresthey interoperate with all other CRAN package on all test environment.The released and tested versions are available via all mirrors ofCRAN network, and can be installedfrom within R via

install.packages("Rcpp")

Release Candidates

For the last several releases, we also made interimcandidate releases available on theRcpp Drat Repo. Versionsfrom adrat repo canbe installed either by just temporarily setting thedrat repo as in

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

or by setting adrat repo morepermanently (as described in the documentation of thedrat package).

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

Source

To install from source, ensure you have a complete packagedevelopment environment for R as discussed in the relevantdocumentation; also see questions 1.2 and 1.3 in theRcpp-FAQ.

Less Common Versions andPlatforms

If you want to run Rcpp on another (not-tested on CRAN) platform, oron releases older than the previous release, we suggest you do your duediligence and test accordingly. Rcpp is provided by an all-volunteerteam with finite resources. We work hard to test Rcpp with severalthousand CRAN packages using it—but we cannot test on outdated versionsof R or your OS.

Support

The best place for questions is theRcpp-develmailing 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 listarchives to see if your question has been asked before.

Theissue ticketsat the GitHub repo are the primary bug reporting interface. As withthe other web resources, previous issues can be searched as well.

Authors

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

License

GPL (>= 2)


[8]ページ先頭

©2009-2025 Movatter.jp