I'm just getting started with Rcpp and wondering if somewhere out there a list of Rcpp sugar functions exists. In the process of translating some of my slow code to C/C++ I'll need functionality provided by base R functions like match
, tabulate
, and which
.
According to Hadley's Advanced R book match
is implemented and the Rcpp-sugar vignette lists a few more available functions though it doesn't seem comprehensive.
What I'm really wondering is: is there a way to find, in the documentation of the package, or elsewhere, what sweet-sweet-sweet functions are available and what I'll have to write for myself? With any other R package I'd go directly to R> help(package = "Rcpp")
but that doesn't seem to be much help in this case.
Description The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries.
Rcpp sugar defines the usual binary arithmetic operators : +, -, *, /. // two numeric vectors of the same size. NumericVector x ; NumericVector y ; // expressions involving two vectors.
As luck would have it, I started to document the Rcpp API in a more accessible manner than what is offered by the doxygen documentation. This documentation includes the Rcpp sugar set of functions alongside usable examples. I'm hopeful that Rcpp should ship with this documentation in the 0.13.0.
In the interim, you can view the source and contribute here:
https://github.com/coatless/rcpp-api/blob/master/rcpp-api-docs.Rmd
Or view a rendered version (that is lagged) here:
http://thecoatlessprofessor.com/programming/rcpp/unofficial-rcpp-api-docs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With