我曾经能够通过系统调用从Matlab调用R:
system('"/usr/bin/R" --no-save < myscript.R')
Run Code Online (Sandbox Code Playgroud)
但是现在,使用Matlab R2012b和R版本3.0.0(2013-04-03) - "Masked Marvel",我在加载库时遇到错误,即使从shell运行它时一切正常.我正在运行MacOSX 10.6.8.
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object'/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so, 6):
Symbol not found: __gfortran_pow_r8_i4
Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
Expected in: /Applications/MATLAB_R2012b.app/sys/os/maci64/libgfortran.2.dylib
in /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
During startup - Warning message:
package 'stats' in options("defaultPackages") was not found
Run Code Online (Sandbox Code Playgroud)