1. Install R in the usual way, then install the latest binary version of Rserve as a package from CRAN from within R, i.e. load R, and enter:
If you download and install the Rserve package manually, make sure that the version is 0.5 or later.
2. Start the Rserve server. You can do so in an R session with:
Alternatively, in a terminal/command prompt, enter:
R CMD Rserve (Linux) <path>\R.exe CMD <path>\Rserve.exe (Windows)
These commands may fail on Rserve not found or R.dll not found for Linux and Windows respectively. If so, a workaround is to copy the Rserve executable into the bin subdirectory of R, e.g. to /usr/lib/R/bin/Rserve or Program Files\R\R-X.X.X\bin\Rserve.exe
If you use the interface often, you may want to create a shortcut for starting Rserve. For Windows, an example entry for the Target of the shortcut might be:
"C:\Program Files\R\R-X.X.X\bin\R.exe" CMD C:\Progra~1\R\R-X.X.X\library\Rserve\Rserve.exe
If the path to Rserve.exe includes spaces, enclosing it in double quotes will not work. A workaround is to use the short directory name as in the example above.
3. In J, install the stats/r addon with Package Manager.
load 'stats/r/rserve' Rget 'rnorm(5)' 2.11491 1.4127 _0.37932 1.62199 _1.16579