Crandore Hub

RInside

C++ Classes to Embed R in C++ (and C) Applications

C++ classes to embed R in C++ (and C) applications A C++ class providing the R interpreter is offered by this package making it easier to have "R inside" your C++ application. As R itself is embedded into your application, a shared library build of R is required. This works on Linux, OS X and even on Windows provided you use the same tools used to build R itself. Numerous examples are provided in the nine subdirectories of the examples/ directory of the installed package: standard, 'mpi' (for parallel computing), 'qt' (showing how to embed 'RInside' inside a Qt GUI application), 'wt' (showing how to build a "web-application" using the Wt toolkit), 'armadillo' (for 'RInside' use with 'RcppArmadillo'), 'eigen' (for 'RInside' use with 'RcppEigen'), and 'c_interface' for a basic C interface and 'Ruby' illustration. The examples use 'GNUmakefile(s)' with GNU extensions, so a GNU make is required (and will use the 'GNUmakefile' automatically). 'Doxygen'-generated documentation of the C++ classes is available at the 'RInside' website as well.

README

This directory provides a simple example of using RInside with the Qt
toolkit---using a SVG renderer.  Usage is standard Qt usage, through cmake.

To build from commandline try the following from this directory:
```
mkdir build; cd build
cmake -S ../cmake -G "Unix Makefiles"
make -j
```

On Ubuntu you would need at least the following packages installed: libqt6svgwidgets6 qt6-tools-dev-tools qt6-base-dev r-base-dev libqt6svg6-dev

What could be easier on some systems, depending on how Qt was installed, is using Qt Creator.
This can be done through "Open Project" and loading "CMakeLists.txt".

If you are on macOs and there are errors on "SUBSTRING" needing 4 arguments try starting QtCreator manually from a terminal.
If you get similar errors on Windows then perhaps R isn't on the PATH and you might need to add the `bin/x64` folder of R manually.

To generate SVG output, this version depends on the cairoDevice package for R
which you may need to install.  According to its author Michael Lawrence,
there are two small issues.  The first is that the SVG produced by
cairoDevice is a littler richer than the subset which Qt can show.  We
address this by filtering the file before viewing it.  The other is an
apparent error in the clipping which we cannot do anything about---Michael
considers it a rendering issue.

All the help by Michael in getting the svg variant to roll is gratefully
acknowledged.  

  

Versions across snapshots

VersionRepositoryFileSize
0.2.19 rolling linux/jammy R-4.5 RInside_0.2.19.tar.gz 1.3 MiB
0.2.19 rolling linux/noble R-4.5 RInside_0.2.19.tar.gz 1.3 MiB
0.2.19 rolling source/ R- RInside_0.2.19.tar.gz 80.3 KiB
0.2.19 latest linux/jammy R-4.5 RInside_0.2.19.tar.gz 1.3 MiB
0.2.19 latest linux/noble R-4.5 RInside_0.2.19.tar.gz 1.3 MiB
0.2.19 latest source/ R- RInside_0.2.19.tar.gz 80.3 KiB
0.2.19 2026-04-26 source/ R- RInside_0.2.19.tar.gz 80.3 KiB
0.2.19 2026-04-23 source/ R- RInside_0.2.19.tar.gz 80.3 KiB
0.2.19 2026-04-09 windows/windows R-4.5 RInside_0.2.19.zip 1.9 MiB
0.2.18 2025-04-20 source/ R- RInside_0.2.18.tar.gz 79.9 KiB

Dependencies (latest)

Imports

LinkingTo