Movatterモバイル変換


[0]ホーム

URL:


Dirk Eddelbuettel

Rcpp: Seamless R and C++Integration

Build StatusLicenseCRANDependenciesCoverage StatusDebian packageLast Commit
DownloadsCRAN useCRAN indirectBioConductor useJSSSpringer useR!TAS

Synopsis

TheRcpppackage help to integrate 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 aTASpaper; anearlierintroduction was also published as aJSS paper) provides a goodentry point to Rcpp as do theRcppwebsite, theRcpp page andtheRcpp Gallery. Fulldocumentation is provided by theRcpp book.

Other highlights:

  • The conversion from C++ to R and back is driven by the templatesRcpp::wrap andRcpp::as which are highlyflexible and extensible, as documented in theRcpp-extendingvignette.

  • Rcpp also provides Rcpp modules, a framework that allows exposingC++ functions and classes to the R level. TheRcpp-modulesvignette details the current set of features of Rcpp-modules.

  • Rcpp includes a concept called Rcpp sugar that brings many Rfunctions into C++. Sugar takes advantage of lazy evaluation andexpression templates to achieve great performance while exposing asyntax that is much nicer to use than the equivalent low-level loopcode. TheRcpp-sugargives an overview of the feature.

  • Rcpp attributes provide a high-level syntax for declaring C++functions as callable from R and automatically generating the coderequired to invoke them. Attributes are intended to facilitate bothinteractive use of C++ within R sessions as well as to support R packagedevelopment. Attributes are built on top of Rcpp modules and theirimplementation is based on previous work in the inline package. See theRcpp-atttributesvignettes for more details.

Documentation

The package ships with nine pdf vignettes, including arecentintroduction to Rcpp now published as apaperin TAS (and as apreprint in PeerJ). Alsoavailable is anearlierintroduction which was published as aJSS paper)

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

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 June2020, there are 1990CRANpackages using Rcpp, a further 203BioConductor 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.

Installation

Released and tested versions of Rcpp are available via theCRAN network, and can be installedfrom within R via

install.packages("Rcpp")

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.

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, Doug Bates, and John Chambers

License

GPL (>= 2)

Initially created: Fri Dec 05 19:58:31 CST 2008
Last modified: Sun May 26 10:12:04 CDT 2024


[8]
ページ先頭

©2009-2025 Movatter.jp