[This article was first published on Thinking inside the box , and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
A new release of Rcpp
awaits inclusion on CRAN and has also
been sent as a .deb to Debian. It will
hit mirrors over the next few days, in the meantime you can get it
here as well.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
This release has a couple new features :
- inline support: the
cfunction
from Oleg Sklyar’s excellent inline package has been imported and adapted. This means simple C++ programs can be defined in an R character vector and passed tocfunction
which will create a complete file that it then compiles, links and loads — giving you access to compiled C++ code right from the R prompt without having to worry about compiler flags, linker options, … Better still, we extended this to not only support Rcpp but any external library via addtional header / linker arguments that will be passed to R via thePKG_CPPFLAGS
,PKG_CXXFLAGS
andPKG_LIBS
environment variables. - this even works on Windoze (if you have the Rtools installed as detailed in the Windows Toolset appendix to the R Installation manual) in exactly the same way. And no folks, that still does NOT mean you can use Visual Whatever — R really requires MinGW as the links in this parapgraph document very plainly. But if and when you have the tools, R’s remarkable consistency across operating systems allows you to use Rcpp and inline in pretty much the same way.
- A handful of new examples for the inline support have been added.
- A new type
RcppSexp
for simple int, double or std::string scalars as well as vectors; this is particularly useful for the inline support. - This also completes the source code reorginsation: every class now has its own header and implementation file
- Last but not least, the package has been relicensed from LGPL-2.1 (or later) to GPL 2 (or later).
To leave a comment for the author, please follow the link and comment on their blog: Thinking inside the box .
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.