我正在使用 perl-cgi 调用
my $call = qx(Rscript tcga_analysis.R $bg_name $ctr_name $set $user);
当我Rscript myRscript.R
在服务器上使用 unix 时它可以工作,但从 perl 我似乎无法加载任何包。我收到以下错误(来自 Apache 日志):
Error in library(gplots) : there is no package called 'gplots'
使用 .libPaths():
> .libPaths()
[1] "/home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1"
[2] "/usr/lib64/R/library"
[3] "/usr/share/R/library"
这在主文件夹中显示了我的个人图书馆。
我尝试使用
library(gplots, lib.loc="/home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1")
但我lib.loc error
听说那里没有图书馆树。我什.Rprofile
至在工作目录中创建了一个包含库路径的文件,但没有成功。我也尝试添加pos=1
但没有成功...
但是,如果我打开 R 并调用library(gplots)
它就可以了
我需要让它从 perl 调用 Rscript,因为它是分析管道的一部分,它使用 Web 界面 -> perl-cgi -> R 来分析一些数据!
谢谢 :)