Seamless embedding of R in C++ programs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
inst
local add two screenshots so that README can use them Feb 28, 2017
man couple minor cleanups and reindents across Mar 18, 2010
src
.Rbuildignore add doxygen builder script (from old svn repo) Feb 7, 2015
.travis.yml use PPA for R 3.5 with Travis (commented-out as no PPA needed here) Sep 2, 2018
ChangeLog
DESCRIPTION
NAMESPACE
README.md
cleanup
cleanup.win
doxyfile release 0.2.11 Feb 12, 2014

README.md

RInside Build Status License CRAN Downloads

Easy embedding of R inside C++

About

The RInside package provides a few classes for seamless embedding of R inside of C++ applications by relying on Rcpp.

Examples

Provided with the package itself are eight subdirectories with examples: from more than a dozen basic command-line examples (in directory standard) to graphical user-interfaces (using both Qt and Wt), linear algebra with Armadillo and Eigen, parallel computing with MPI to a sandboxed server.

The simplest example (modulo its header) is examples/standard/rinside_sample0.cpp

#include <RInside.h>                    // for the embedded R via RInside

int main(int argc, char *argv[]) {

    RInside R(argc, argv);              // create an embedded R instance 

    R["txt"] = "Hello, world!\n";	    // assign a char* (string) to 'txt'

    R.parseEvalQ("cat(txt)");           // eval the init string, ignoring any returns

    exit(0);
}

The Qt example directory produces this application for showing how to use R (to estimate densities) inside a C++ executable (providing the GUI):

The code is portable across operating systems. Similar, the Wt example directory contains this C++-based web application doing the same:

See Also

The RInside web page has some more details.

Authors

Dirk Eddelbuettel and Romain Francois

License

GPL (>= 2)