22
33### Seamless R and C++ Integration
44
5- The [ Rcpp package] ( https://cran.r-project.org/package=Rcpp ) provides R functions and a C++ library
5+ The [ Rcpp package] ( https://cran.r-project.org/package=Rcpp ) provides R
6+ functions and a (header-only for client packages) C++ library greatly
67facilitating the integration of R and C++.
78
8- R data types ( ` SEXP ` ) are matched to C++ objects in a class hierarchy. All R
9- types are supported (vectors, functions, environment, etc ...) and each
10- type is mapped to a dedicated class. For example, numeric vectors are
11- represented as instances of the Rcpp::NumericVector class, environments are
12- represented as instances of Rcpp::Environment, functions are represented as
13- Rcpp::Function, etc ...
14- The
9+ All underlying R types and objects, _ i.e. _ , everything a ` SEXP ` represents internally
10+ in R, are matched to corresponding C++ objects. This covers anything from vectors,
11+ matrices or lists to environments, functions and more. Each ` SEXP ` variant is
12+ automatically mapped to a dedicated C++ class. For example, numeric vectors are
13+ represented as instances of the ` Rcpp::NumericVector ` class, environments are
14+ represented as instances of ` Rcpp::Environment ` , functions are represented as
15+ ` Rcpp::Function ` , etc ... The
1516[ Rcpp-introduction] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf )
16- vignette (also published as a [ JSS paper] ( http://www.jstatsoft.org/v40/i08/ ) ) provides a good
17- entry point to Rcpp as do the [ Rcpp website] ( http://www.rcpp.org ) , the
18- [ Rcpp page] ( http://dirk.eddelbuettel.com/code/rcpp.html ) and the
19- [ Rcpp Gallery] ( http://gallery.rcpp.org ) . Full documentation
20- is provided by the [ Rcpp book] ( http://www.rcpp.org/book/ ) .
21-
22- Conversion from C++ to R and back is driven by the templates ` Rcpp::wrap `
17+ vignette (now published as a
18+ [ TAS paper] ( https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2017.1375990 ) ; an
19+ [ earlier introduction] ( https://cloud.r-project.org/web/packages/Rcpp/vignettes/Rcpp-jss-2011.pdf )
20+ was also published as a [ JSS paper] ( http://www.jstatsoft.org/v40/i08/ ) )
21+ provides a good entry point to Rcpp as do the [ Rcpp
22+ website] ( http://www.rcpp.org ) , the [ Rcpp
23+ page] ( http://dirk.eddelbuettel.com/code/rcpp.html ) and the [ Rcpp
24+ Gallery] ( http://gallery.rcpp.org ) . Full documentation is provided by the
25+ [ Rcpp book] ( http://www.rcpp.org/book/ ) .
26+
27+ Other highlights:
28+
29+ - The conversion from C++ to R and back is driven by the templates ` Rcpp::wrap `
2330and ` Rcpp::as ` which are highly flexible and extensible, as documented
2431in the [ Rcpp-extending] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-extending.pdf ) vignette.
2532
26- Rcpp also provides Rcpp modules, a framework that allows exposing
33+ - Rcpp also provides Rcpp modules, a framework that allows exposing
2734C++ functions and classes to the R level. The [ Rcpp-modules] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-modules.pdf ) vignette
2835details the current set of features of Rcpp-modules.
2936
30- Rcpp includes a concept called Rcpp sugar that brings many R functions
37+ - Rcpp includes a concept called Rcpp sugar that brings many R functions
3138into C++. Sugar takes advantage of lazy evaluation and expression templates
3239to achieve great performance while exposing a syntax that is much nicer
3340to use than the equivalent low-level loop code. The [ Rcpp-sugar] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-sugar.pdf )
3441gives an overview of the feature.
3542
36- Rcpp attributes provide a high-level syntax for declaring C++
43+ - Rcpp attributes provide a high-level syntax for declaring C++
3744functions as callable from R and automatically generating the code
3845required to invoke them. Attributes are intended to facilitate both
3946interactive use of C++ within R sessions as well as to support R
@@ -43,18 +50,28 @@ See the [Rcpp-atttributes](https://cran.r-project.org/package=Rcpp/vignettes/Rcp
4350
4451### Documentation
4552
46- The package ships with nine pdf vignettes.
47-
48- Additional documentation is available via the
49- [ JSS paper] ( http://www.jstatsoft.org/v40/i08/ ) by Eddelbuettel and
50- Francois (2011, JSS) paper (corresponding to the 'intro' vignette)
51- and the [ book] ( http://www.rcpp.org/book ) by Eddelbuettel (2013, Springer);
52- see 'citation("Rcpp")' for details.
53+ The package ships with nine pdf vignettes, including a [ recent introduction to
54+ Rcpp] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf ) now
55+ published as a [ paper in
56+ TAS] ( https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2017.1375990 ) (and as a
57+ [ preprint in PeerJ] ( https://peerj.com/preprints/3188/ ) ). Also available is an
58+ [ earlier
59+ introduction] ( https://cloud.r-project.org/web/packages/Rcpp/vignettes/Rcpp-jss-2011.pdf )
60+ which was published as a [ JSS paper] ( http://www.jstatsoft.org/v40/i08/ ) )
61+
62+ Among the other vignettes are the [ Rcpp
63+ FAQ] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf ) and the
64+ introduction to [ Rcpp
65+ Attributes] ( https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-attributes.pdf ) .
66+ Additional documentation is available via the [ Rcpp book] ( http://www.rcpp.org/book )
67+ by Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details.
5368
5469### Examples
5570
5671The [ Rcpp Gallery] ( http://gallery.rcpp.org ) showcases over one hundred fully
57- documented and working examples.
72+ documented and working examples. The
73+ [ package RcppExamples] ( https://cran.r-project.org/package=RcppExamples ) contains a few basic
74+ examples covering the core data types.
5875
5976A number of examples are included as are 1429 unit tests in 618 unit
6077test functions provide additional usage examples.
@@ -66,7 +83,7 @@ available for code relying on the older interface. New development should
6683always use this Rcpp package instead.
6784
6885Other usage examples are provided by packages using Rcpp. As of July 2018,
69- there are 1402 [ CRAN] ( https://cran.r-project.org ) packages using Rcpp, a further
86+ there are 1408 [ CRAN] ( https://cran.r-project.org ) packages using Rcpp, a further
708791 [ BioConductor] ( http://www.bioconductor.org ) packages in its current release
7188as well as an unknown number of GitHub, Bitbucket, R-Forge, ... repositories
7289using Rcpp. All these packages provide usage examples for Rcpp.
0 commit comments