Interfaces/R/Jserver4R/Methods

From J Wiki
< Interfaces‎ | R
Jump to navigation Jump to search
Overview | Methods | Examples | Quirks

The following methods are provided by the shared library. In practice, R cover functions can be defined to call these methods, see the Examples page.

rjinit bin, dll, profile, loadprofile open connection to J (see below), returning result code
rjdo exp execute J expression, returning a result code
rjexec exp execute J expression and return result
rjget name get value of J noun
rjset name value set J name to value, returning a result code
rjgetr get output from last J call

The rjinit arguments are:

  • path to the J bin directory
  • path to the J engine
  • path to the J profile
  • whether the profile should be loaded

These are defined in jserver.R, which should be customized for your use. The call is then

.Call("rjinit", pathbin, pathdll, pathprofile, loadprofile=TRUE)

Any result code is either 0=OK or the error code from the J engine call.