[R] Installing RSPerl and Statistics::R

Luc Vereecken Luc.Vereecken at chem.kuleuven.ac.be
Tue Jul 12 18:28:26 CEST 2005


Hi list,

For my research, I started using R as a statistics engine, driven by 
perl scripts that manage my data and computational jobs. I recently 
upgraded my cluster to Suse 9.2, and obviously wanted to upgrade R to 
it's latest version, 2.1.1. Installation of R-2.1.1 went flawlessly 
thanks to the rpm's created by Detlef Steuer (see cran, thanks Detlef).

To interface perl and R, two packages are available: RSPerl and 
Statistics::R. Neither of the two installed out of the box, so I 
describe the problems here, as well as their solutions, for use by others.


My scripts are based on a perl package Statistics::R, available from 
the perl CPAN in version 0.02. Installation of such a perl package is 
normally performed by doing:
         perl -MCPAN -e 'install Statistics::R'
but the installation failed due to errors in the tests requiring me 
to ctrl-C the test program. I was able to force an install of this 
package by entering the CPAN shell:
         perl -MCPAN -e shell
and executing a forced install:
         force install Statistics::R
killing the test program halfway the install. Some investigation 
learned that Statistics::R as it is available at this time can not 
possible run as R is invoked as
         R --slave --vanilla --gui=none
which used to work in older version of R, but the current versions no 
longer support --gui=none causing an error "ERROR: unknown GUI none". 
Strangely, invoking "R BATCH" sets the gui to none according to the 
manual, so either gui=none still exists internally but is simply no 
longer supported by the R script, or the R BATCH manual is not 
correctly updated.
Statistics::R can be installed and made to work by using the forced 
install described above, and by editing the startup perl routines 
removing the gui=none option from the command line. This command line 
can be found in 
/usr/lib/perl5/site_perl/5.8.5/Statistics/R/Bridge/Linux.pm for my 
installation, it should be similar for other perl versions and 
library-locations.


RSPerl 0.7, available from www.omagahat.org/RSPerl/ , gives on it's 
main page the command
         R INSTALL -c -l <wherever> RSPerl_0.7-0.tar.gz
or
         R INSTALL -c -l <wherever> --configure-args='--with-in-perl' 
RSPerl_0.7-0.tar.gz
as installation command. In the "calling R from perl" PDF document, 
the command given is:
         R CMD INSTALL -c -configure-args='-with-in-perl' RSPerl
None of these commands work due to typo's.
A working command line is:
         R CMD INSTALL -c -l <installdir> 
--configure-args='--with-in-perl' RSPerl_0.7-0.tar.gz

Hope this is of use to anyone,

Luc Vereecken




More information about the R-help mailing list