我正在尝试从 Matlab 中运行 R 脚本,我得到与此海报相同的错误: Calling R from Matlab
据我所知,情况是一样的,除了我的系统正在运行 LinuxMint(发行版 14 Nadia,内核 3.5.0-17-generic)并且该帖子中的解决方案对我不起作用。有人可以提出进一步的建议吗?我难住了。
就像上面线程中的海报一样,我的调用是在 shell 中工作的,而不是在 matlab 中。
r_script.R 包含:
foo <- rnorm( 100 )
cat( sd( foo ), '\n' )
cat( mean( foo ), '\n' )
我在 Matlab 中收到的错误消息:
>> system( 'Rscript /tmp/r_script.R' )
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error: could not find function "rnorm"
Execution halted
ans =
1
>> !unset DYLD_LIBRARY_PATH;
>> system( 'Rscript /tmp/r_script.R' )
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error: could not find function "rnorm"
Execution halted
ans =
1