- Notifications
You must be signed in to change notification settings - Fork0
Seamless R and C++ Integration
License
thirdwing/Rcpp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TheRcpp package provides R functions and a C++ libraryfacilitating the integration of R and C++.
R data types (SEXP) are matched to C++ objects in a class hierarchy. All Rtypes are supported (vectors, functions, environment, etc ...) and eachtype is mapped to a dedicated class. For example, numeric vectors arerepresented as instances of the Rcpp::NumericVector class, environments arerepresented as instances of Rcpp::Environment, functions are represented asRcpp::Function, etc ...TheRcpp-introductionvignette (also published as aJSS paper) provides a goodentry point to Rcpp as do theRcpp website, theRcpp page and theRcpp Gallery. Full documentationis provided by theRcpp book.
Conversion from C++ to R and back is driven by the templatesRcpp::wrapandRcpp::as which 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.
Additional documentation is available via theJSS paper by Eddelbuettel andFrancois (2011, JSS) paper (corresponding to the 'intro' vignette)and thebook by Eddelbuettel (2013, Springer);see 'citation("Rcpp")' for details.
TheRcpp Gallery showcases over one hundred fullydocumented and working examples.
A number of examples are included as are 1394 unit tests in 606 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 March 2018,there are 1309CRAN packages using Rcpp, a further91BioConductor 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
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- C++90.3%
- R9.1%
- TeX0.4%
- C0.2%
- Shell0.0%
- Makefile0.0%