From rispoli at tigem.it  Mon Oct 20 11:43:44 2008
From: rispoli at tigem.it (Rispoli Rossella)
Date: Mon, 20 Oct 2008 11:43:44 +0200
Subject: [Rd] problem with The R/Splus--Perl Interface
Message-ID: <C4917498-6CE3-43C0-8815-3C5BFDB3BE49@tigem.it>

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/



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