[Bioc-devel] R from Perl -- RSPerl and lines function.
Florence Combes
fcombes at gmail.com
Thu May 19 16:00:25 CEST 2005
Dear R-helpers,
I am running well Perl and R on my Debian Linux, and I tried RSPerl.
Installation is ok and all simple functions run well. But I have a
problem to call the "lines" function.
I would like to draw an histogram with the density curve on. Is is OK
in R with the command:
>x<-rnorm(1000)
>hist(x,prob=T)
>lines(density(x))
for example.
Now, I have a Perl script with which pars files, and I obtain data in
a list @distance. I draw an hist with RSPerl command (from Perl):
--------------------------
(---Perl script---)
&R::initR("--silent");
&R::library("RSPerl");
@Rdata=&R::call("as.numeric", \@distance);
&R::callWithNames("hist", {'', \@Rdata, 'main', '', 'xlab',
"Distribution of the distances between oligo-5' and sequence 3'",
'br', 15, 'col', 'gray', 'prob', 'T'} );
&R::call("lines", ("density", \@Rdata)) );
sleep(4);
&R::call("dev.off");
exit;
-----------------------------
All runs well: I obtained the histogram graph, and it seems that the
density call runs well since I have the message
"Performed the call, result has length 7"
and I read the density fuction results in 7 parameters;
but just after I have a message like "segmentation fault".
I cannot understand what happens ?
Has someone already encountered this problem or know how to abtain an
histogram and the density line with RSPerl ???
Thanks a lot for your help, caus I tried all I could think of ...
Florence.
More information about the Bioc-devel
mailing list