[R] Problem with Statistics::R Save plots

From: Filipe Garrett <fgarret_at_ub.edu>
Date: Thu 25 May 2006 - 20:41:55 EST


Hi all,

I've recently tried to use the perl module Statistics::R-0.02. I'm using R v2.2.1 and Perl 5.8.7 on WinXP and Linux. When I use the R GUI or Rterm I have no problem in plotting and saving all the graphics or data. For example:

/*pdf("file.pdf")
x <- c(1,3,-3,1,233,112,6,9,12)
boxplot(x)
dev.off()*/

However when I try to make the same through a perl script I get empty files!!! Initially I got an error message about dev.off() but fixed it by introducing the device number (in this case "2"). Does anyone knows what may be the problem? The perl code I'm using:

/*use Statistics::R;

my $R = Statistics::R->new();
$R->startR ;
$R->send('pdf("file.pdf")');
$R->send('x <- c(1,3,-3,1,233,112,6,9,12)');
$R->send('boxplot(x)');
$R->send('dev.off(2)') ;
$R->stopR() ;* /

Thanks in adv

FG

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 25 21:56:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 May 2006 - 22:10:18 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.