Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2911cd2a6e

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
Makefile
R.c
R.ico
RGui32.manifest
RGui64.manifest
RSetReg.c
Rcmd.exe.manifest
Renviron.c
Rfe.c
Rterm32.manifest
Rterm64.manifest
graphappmain.c
make.rtest
open.c
rcico.rc
rcmd.c
rcmdfn.c
readme
rgico.rc
rgui.c
rpwd.c
rterm.c
rtest.c
rtico.rc

readme

Linking the R DLL into other applications
=========================================

The file rtest.c provides an example of linking the R engine into
another front end.  To build it

- edit it to set Rp->rhome and Rp->home appropriately, or set
  appropriate environmental variables.

- to make with gcc,  make -f make.rtest

This provides an rterm-like test front end. The main loop is in the
main program here: R_ReplDLLdo1() parses one line (up to ; or \n) and
returns 1 if complete, 2 if incomplete as an R expression.

There is a callback available during evaluation, plotting and console
I/O, intended to be used for processing GUI events.  (The pager and
graphics windows' GUI events are handled at these times by
ProcessEvents: the callback is called from within ProcessEvents.)
Note that in this version console input blocks the process so pager
and graphics windows will not respond during input: a real application
that uses these windows needs to have a non-blocking ReadConsole
function.  Rterm uses a separate thread to achieve this.


An alternative to linking the import library would be to explicitly
load the DLL from a known location or after searching for it.

The example shows one way to handle user interrupts, although it might
be as easy to generate a SIGINT directly from a GUI front end.  For
this to be useful you will want to set R_Interactive to be true, and
you will need to use SETJMP to jump back to somewhere useful in your
code.

You will not (easily) be able to use Borland C++, as that uses leading
underscores in its library functions, and R.dll is built without.



A R proxy DLL
=============

Files bdx* and rproxy* are used to build a proxy DLL (by Thomas Baier) for
use with his automation server StatConnectorSrv.exe.

The interface can evaluate commands and transfer simple R objects (e.g.
vectors and matrices).

Look on CRAN under Software->Other->Non-standard packages for the
automation server.
Something went wrong with that request. Please try again.