Including R code in perl

#example:

 

use Statistics::R;#use R in perl
my $R = Statistics::R->new() ;
$R->startR ;
$R->send(qq`x1<-fisher.test(matrix(c(919,82,29946,3264),ncol = 2))
p<-x1\$p.value
print(p)`);
my $ret = $R->read;
print $ret,"\n";
$R->stopR();

posted on 2017-08-15 00:44  Vermont  阅读(102)  评论(0编辑  收藏  举报

导航