+ -
当前位置:首页 → 问答吧 → 请教多进程中调用R中的一段英文,没看明白

请教多进程中调用R中的一段英文,没看明白

时间:2011-06-21

来源:互联网

用了一个模块,叫statistics::R。现在要多进行中运行,模块有说明,是这样的,但是没有看太明白。
是要先写一个statistics-r.pl文件,再用statistics-r.pl start吗?
还是说只要程序里有 那段代码就行了。请高手解答一下。
EXECUTION FOR MULTIPLE PROCESS ^

The main pourpose of Statistics::R is to start a single R interpreter that hear multiple Perl process.

Note that to do that R and Perl need to be running with the same user/group level.

To start the Statistics::R bridge you can use the script statistics-r.pl:
  1.   $> statistics-r.pl start
复制代码
From your script you need to use the start_sharedR() option:
  1.   use Statistics::R;
  2.   
  3.   my $R = Statistics::R->new();
  4.   
  5.   $R->start_sharedR;
  6.   
  7.   $R->send('x = 123');
  8.   
  9.   exit;
复制代码
Note that in the example above the method stopR() wasn't called, sine it will close the bridge.

作者: kingwmj   发布时间: 2011-06-21

那个文件一般安装到 site/bin 中了

作者: zhlong8   发布时间: 2011-06-21