Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork219
Seamless R and C++ Integration
License
RcppCore/Rcpp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TheRcpp package provides Rfunctions and a (header-only for client packages) C++ library greatlyfacilitating the integration of R and C++.
All underlying R types and objects,i.e., everything aSEXP represents internallyin R, are matched to corresponding C++ objects. This covers anything from vectors,matrices or lists to environments, functions and more. EachSEXP variant isautomatically mapped to a dedicated C++ class. For example, numeric vectors arerepresented as instances of theRcpp::NumericVector class, environments arerepresented as instances ofRcpp::Environment, functions are represented asRcpp::Function, etc ... TheRcpp-introductionvignette (now published as aTAS paper; anearlier introductionwas also published as aJSS paper)provides a good entry point to Rcpp as do theRcppwebsite, theRcpppage and theRcppGallery. Full documentation is provided by theRcpp book.
Other highlights:
The conversion from C++ to R and back is driven by the templates
Rcpp::wrapandRcpp::aswhich are highly flexible and extensible, as documentedin theRcpp-extending vignette.Rcpp also provides Rcpp modules, a framework that allows exposingC++ functions and classes to the R level. TheRcpp-modules vignettedetails the current set of features of Rcpp-modules.
Rcpp includes a concept called Rcpp sugar that brings many R functionsinto C++. Sugar takes advantage of lazy evaluation and expression templatesto achieve great performance while exposing a syntax that is much nicerto use than the equivalent low-level loop code. 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 Rpackage development. Attributes are built on top of Rcpp modules andtheir implementation is based on previous work in the inline package.See theRcpp-atttributes vignettes for more details.
The package ships with nine pdf vignettes, including arecent introduction toRcpp nowpublished as apaper inTAS (and as apreprint in PeerJ). Also available is anearlierintroductionwhich was published as aJSS paper)
Among the other vignettes are theRcppFAQ and theintroduction toRcppAttributes.Additional documentation is available via theRcpp bookby Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details.
TheRcpp Gallery showcases over one hundred fullydocumented and working examples. Thepackage RcppExamples contains a few basicexamples covering the core data types.
A number of examples are included as are 1437 unit tests in 622 unittest functions provide additional usage examples.
An earlier version of Rcpp, containing what we now call the 'classic RcppAPI' was written during 2005 and 2006 by Dominick Samperi. This code hasbeen factored out of Rcpp into the package RcppClassic, and it is stillavailable for code relying on the older interface. New development shouldalways use this Rcpp package instead.
Other usage examples are provided by packages using Rcpp. As of September 2019,there are 1790CRAN packages using Rcpp, a further176BioConductor packages in its current releaseas well as an unknown number of GitHub, Bitbucket, R-Forge, ... repositoriesusing Rcpp. All these packages provide usage examples for Rcpp.
Released and tested versions of Rcpp are available via theCRAN network, and can be installed from within R via
install.packages("Rcpp")To install from source, ensure you have a complete package developmentenvironment for R as discussed in the relevant documentation; also seequestions 1.2 and 1.3 in theRcpp-FAQ.
The best place for questions is theRcpp-develmailing list hosted at R-forge. Note that in order to keep spam down, you mustbe a subscriber in order to post. One can also consult the list archives to seeif your question has been asked before.
Another option is to useStackOverflow and its 'rcpp' tag.Search functionality (usercpp in squared brackets as in[rcpp] my question termsto tag the query) is very valuable as many questions have indeed been asked, andanswered, before.
Theissue tickets at the GitHub repoare the primary bug reporting interface. As with the other web resources,previous issues can be searched as well.
Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,Nathan Russell, Doug Bates, and John Chambers
GPL (>= 2)
About
Seamless R and C++ Integration
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.