[Rd] problem with The R/Splus--Perl Interface

Rispoli Rossella rispoli at tigem.it
Mon Oct 20 11:43:44 CEST 2008


Hi,
I'm new to using the R/Splus--Perl Interface, and I have same problem  
to understand how to pass the structure from Perl to R. I'm trying to  
call the function 'max' on the bi-dimensional array, before I tried to  
do the same thing on the vector as follows:

@x = &R::call("seq", 1,10);
$val=&R::call("max", at x);
print "val $val \n";
and it works, after this I try to do the same things on the matrix as  
follows:

'create matrix x'
$val=&R::call("max", at t);

it's dosen't works and return me this error:
invalid 'type' (list) of argument
Caught error in R::call()

After This I tried also to create a matrix from the perl code with the  
command call ('matrix'....) as follows:
'create array t'
my @v=&R::call("matrix",\@t,2,3);
or
my @v=&R::eval("matrix(@t,2,3)");
But doesn't work.

At the end my question is: there is a mode to pass a matrix from perl  
to R, and if it dosen't exist, how can I call a R function with an bi- 
dimensional array created in Perl script using the The R/Splus--Perl  
Interface?
----------------------------------------------------------------------------
Rossella Rispoli,
Bioinformatics Core Group
Telethon Institute of Genetics and Medicine (TIGEM)
Via P. Castellino 111, 80131, Naples, Italy
Tel: +39 081 6132 498
Fax: +39 081 6132 351
Web: http://bioinformatics.tigem.it/



More information about the R-devel mailing list