The R/Splus--Perl Interface

Overview

This package provides a bidirectional interface for
calling R from Perl and Perl from R. This embeds one interpreter
(e.g. R) within the process of the other interpreter (e.g. Perl).
One can call routines and functions in the other language
as if they were part of the local environment.
This avoids having to program in a different language
while making the functionality in the other system
transparently available with no additional coding.
Values computed in one call are available to future calls. This makes
Perl more interactive, also allows the R/Splus programmer to use
convenient and familiar syntax to mix computations in the two
different sytems, and provide statistical functionality
to Perl applications..

One of the main benefits of this package is that it avoids the cost of
spawning perl processes for simple things and allows commands to be
cumulated over a session rather than specified ahead-of-time in a Perl
script. Additionally, it provides accesss to many Perl modules and
tools whose counterparts do not exist in R/SPlus. See
CPAN

Download

Installation

R

R CMD INSTALL -c -l <wherever> RSPerl_0.92-1.tar.gz

By default, it will do some manipulation to link in
C code for the installed Perl modules that use C code.
This can be controlled by setting the environment
variable PERL_MODULES.
To avoid any modules, set the environment variable PERL_MODULES
to "no".

To find the Perl modules for the R interface, and to find the
necessary shared libraries/DLLs, please use either
of the scripts RSPerl.csh or RSPerl.bsh in the RSPerl/scripts/
directory where you installed the package.
These set important environment variables.

SPlus 5 & 6

This code has been developed to run within S-Plus.
This has not been extensively maintained, but should
be reasonably straightforward to upgrade.

A (very) brief description of calling R from Perl.
This only works on Unix. (Only tested on Linux.)
Do not expect this to run on Windows.
Also, take a look at example Perl scripts that call
R to do some basic things.

Test for many different aspects of R,
including loading a library, examining the search path
and object list, calling random
number generators, plotting, using
simple function calls, named argument calls,
and expression evaluation.