Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Seamless R and C++ Integration

License

NotificationsYou must be signed in to change notification settings

RcppCore/Rcpp

Repository files navigation

Seamless R and C++ Integration

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.

Documentation

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.

Examples

TheRcpp Gallery showcases over one hundred fullydocumented and working examples.

A number of examples are included as are 1385 unit tests in 599 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 2017,there are 975CRAN packages using Rcpp, a further89BioConductor 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.

Installation

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.

Authors

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

License

GPL (>= 2)

Sponsor this project

 

Packages

No packages published

Contributors75


[8]ページ先頭

©2009-2025 Movatter.jp