259 |
20 Apr 07 |
jari |
$Id$ |
259 |
20 Apr 07 |
jari |
2 |
|
259 |
20 Apr 07 |
jari |
3 |
|
257 |
20 Apr 07 |
mattias |
The following steps are important when using the BaseWebService perl module |
257 |
20 Apr 07 |
mattias |
from R. |
257 |
20 Apr 07 |
mattias |
6 |
|
257 |
20 Apr 07 |
mattias |
0. The BaseWebService.pm module requires the following modules to work: |
257 |
20 Apr 07 |
mattias |
8 |
|
257 |
20 Apr 07 |
mattias |
SOAP::Lite |
257 |
20 Apr 07 |
mattias |
LWP::Simple |
257 |
20 Apr 07 |
mattias |
11 |
|
257 |
20 Apr 07 |
mattias |
1. Installation of R (currently version 2.4.1) |
257 |
20 Apr 07 |
mattias |
13 |
|
257 |
20 Apr 07 |
mattias |
When running the configure script it is important that you specify the |
257 |
20 Apr 07 |
mattias |
15 |
|
257 |
20 Apr 07 |
mattias |
--enable-R-shlib |
257 |
20 Apr 07 |
mattias |
17 |
|
257 |
20 Apr 07 |
mattias |
option to the configure script in order to build a shared/dynamic library. |
257 |
20 Apr 07 |
mattias |
19 |
|
257 |
20 Apr 07 |
mattias |
20 |
|
257 |
20 Apr 07 |
mattias |
2. Installation of RSPerl (currently RSPerl_0.91-2.tar.gz) |
257 |
20 Apr 07 |
mattias |
22 |
|
257 |
20 Apr 07 |
mattias |
2.1 Download the RSPerl package from http://www.omegahat.org/RSPerl/ |
257 |
20 Apr 07 |
mattias |
24 |
|
257 |
20 Apr 07 |
mattias |
2.2 Normally one can install an R package directly using the tar archive, |
257 |
20 Apr 07 |
mattias |
but now we need a script inside the archive. So, unpack this file |
257 |
20 Apr 07 |
mattias |
(e.g. tar xvzf RSPerl_0.91-2.tar.gz). |
257 |
20 Apr 07 |
mattias |
28 |
|
257 |
20 Apr 07 |
mattias |
2.3 We need to figure out what perl modules to link during compile |
257 |
20 Apr 07 |
mattias |
time. For a discussion on this issue, see the FAQ.html at the top most |
257 |
20 Apr 07 |
mattias |
directory. |
257 |
20 Apr 07 |
mattias |
32 |
|
257 |
20 Apr 07 |
mattias |
Enter the top most RSPerl directory (cd RSPerl) and issue the command |
257 |
20 Apr 07 |
mattias |
34 |
|
257 |
20 Apr 07 |
mattias |
unix>> perl -s modules.pl -modules |
257 |
20 Apr 07 |
mattias |
36 |
|
257 |
20 Apr 07 |
mattias |
37 |
|
257 |
20 Apr 07 |
mattias |
Paste the output from this script into and file and enclose the line in double |
257 |
20 Apr 07 |
mattias |
quotes. Also, add in the beginning of the line: |
257 |
20 Apr 07 |
mattias |
40 |
|
257 |
20 Apr 07 |
mattias |
export PERL_MODULES= |
257 |
20 Apr 07 |
mattias |
42 |
|
257 |
20 Apr 07 |
mattias |
Now paste this line into your unix shell and execute the command. We |
257 |
20 Apr 07 |
mattias |
have now created the environment variable PERL_MODULES. |
257 |
20 Apr 07 |
mattias |
45 |
|
257 |
20 Apr 07 |
mattias |
2.4 Leave the RSPerl directory and goto the directory where you have |
257 |
20 Apr 07 |
mattias |
the archive (RSPerl_0.91-2.tar.gz) |
257 |
20 Apr 07 |
mattias |
48 |
|
257 |
20 Apr 07 |
mattias |
2.5 Install RSPerl using the command (here you might have to be root if |
257 |
20 Apr 07 |
mattias |
you have installed R as root) |
257 |
20 Apr 07 |
mattias |
51 |
|
257 |
20 Apr 07 |
mattias |
unix>> R CMD INSTALL RSPerl_0.91-2.tar.gz |
257 |
20 Apr 07 |
mattias |
53 |
|
257 |
20 Apr 07 |
mattias |
This should run quite fast. |
257 |
20 Apr 07 |
mattias |
55 |
|
257 |
20 Apr 07 |
mattias |
2.6 Now test the RSPerl interface by starting R |
257 |
20 Apr 07 |
mattias |
57 |
|
257 |
20 Apr 07 |
mattias |
unix>> R |
257 |
20 Apr 07 |
mattias |
59 |
|
257 |
20 Apr 07 |
mattias |
R> library(RSPerl) |
257 |
20 Apr 07 |
mattias |
61 |
|
257 |
20 Apr 07 |
mattias |
This last command should run without error (you might get warnings). |
257 |
20 Apr 07 |
mattias |
63 |
|
257 |
20 Apr 07 |
mattias |
2.7 If you get an error above you have to go back and try to delete some |
257 |
20 Apr 07 |
mattias |
of the modules in the PERL_MODULES environment variable. The error |
257 |
20 Apr 07 |
mattias |
message that you get might be helpful in order to figure out what |
257 |
20 Apr 07 |
mattias |
modules to remove from PERL_MODULES. Then execute the new "export |
257 |
20 Apr 07 |
mattias |
PERL_MODULES="..." expression and redo item 2.5-2.6. Hopefully it |
257 |
20 Apr 07 |
mattias |
should now run without errors. |
257 |
20 Apr 07 |
mattias |
70 |
|
257 |
20 Apr 07 |
mattias |
3. Testing the BaseWebService.pm module from R |
257 |
20 Apr 07 |
mattias |
72 |
|
257 |
20 Apr 07 |
mattias |
The websFunc.R file contains useful R functions that works as a simple |
257 |
20 Apr 07 |
mattias |
wrapper for most of the methods in the BaseWebService.pm perl module. |
257 |
20 Apr 07 |
mattias |
See the webs-test.R for an example of how to use these functions. |