Interfaces/R/Rserver/Overview

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

This is an interface to R for J64 on Windows/Mac/Linux.

J loads a shared library to call R installed on the same machine.

Either R should be on the path, or the R_HOME environment variable should be set when calling J, as in:

SET R_HOME="c:\Program Files\R\R-4.2.2"   windows
export R_HOME=/usr/lib/R                  linux
export R_HOME=/usr/lib64/R                RHEL
export R_HOME=/Library/Frameworks/R.framework/Resources    Mac
export R_HOME=/usr/local/lib/R                             depending on installation
export R_HOME=/opt/homebrew/lib/R

Note - in recent versions of J and Windows, it may be necessary to set the full path to R instead of, or as well as, R_HOME. Experiment to see which works. For example, replace the R_HOME line with:

set PATH=%PATH%;C:\Program Files\R\R-4.2.2\bin\x64

The shared libraries are distributed in ~addons/stats/r/lib with source in the Public repository at stats/r/rserver/lib.