I used to be able to call R from Matlab with a system call:
system('"/usr/bin/R" --no-save < myscript.R')
But now, using Matlab R2012b and R version 3.0.0 (2013-04-03) -- "Masked Marvel", I get errors when loading libraries, even though everything work just fine when I run it from the shell. I am running 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
Unset environment variable DYLD_LIBRARY_PATH before calling R script:
>> !/usr/bin/Rscript ms.R
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_R2013a.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
Error: could not find function "rnorm"
Execution halted
>> !unset DYLD_LIBRARY_PATH; /usr/bin/Rscript ms.R
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
-0.09727 0.03573
Related
I have tried adding the path in the terminal using the solution given here and it said was successfully added but still I am unable to load the RWeka package.
It is giving me the below error -
Error: package or namespace load failed for ‘RWeka’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava/libs/rJava.so, 6): Symbol not found: _EXTPTR_PTR
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava/libs/rJava.so
Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava/libs/rJava.so
In addition: Warning message:
package ‘RWeka’ was built under R version 4.0.2
What could be done? Please Help!
So, I tried to install a package ConvergenceConcepts in RStudio and it threw me an error message:
ERROR: lazy loading failed for package ‘ConvergenceConcepts’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/ConvergenceConcepts’
and a warning, that the package had non-zero exit status. How could I resolve this?
Error loading ConvergenceConcepts library:
Loading required package: tcltk
xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
Error: package or namespace load failed for ‘tcltk’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /opt/X11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so
Reason: image not found
Error: package ‘tcltk’ could not be loaded
In addition: Warning message:
In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Error when I try to add tcltk library:
library(tcltk)
xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
Error: package or namespace load failed for ‘tcltk’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /opt/X11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/tcltk/libs/tcltk.so
Reason: image not found
In addition: Warning message:
In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Error in dyn.load(file, DLLpath = DLLpath, ...) :
无法载入共享目标对象‘/usr/lib/R/library/stats/libs/stats.so’::
/usr/lib/x86_64-linux-gnu/libgfortran.so.3: symbol __netf2, version GCC_4.3.0 not defined in file libgcc_s.so.1 with link time reference
在启动过程中 - Warning message:
package ‘stats’ in options("defaultPackages") was not found
When I firstly install R, it works and shows no warning message.
I can only fix this problem by using sudo R to run R program. And I tried to create a environment variable DLLpath as the error says, but it did not work.
How can I fix this?
I am trying to get extension R to work with mediawiki but have run into a roadblock with the following error:
REngine.php: sh: /usr/bin/R: No such file or directory
Does anyone know how to correct this issue? If I look at mediawiki/Special:Version, I can see R listed under extensions as version 0.14, but if I try to use <R>1:10</R> it throws that error.
After the comment to add a symlink below I was able to get a little further. I added the following symlink to my brew installation of R:
ln -s /usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/bin/R /usr/bin/R
and this was the output:
REngine.php: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
In addition: Warning message:
package 'grDevices' in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
In addition: Warning message:
package 'graphics' in options("defaultPackages") was not found
During startup - Warning message:
package 'stats' in options("defaultPackages") was not found
<!--- Start of program --->
[1] 1 2 3 4 5 6 7 8 9 10
<!--- End of program --->
Error: could not find function "dev.cur"
Execution halted
Also the code I hae on the mediawiki page is:
Test
<R>1:10</R>
I'm having trouble installing sourceforge package 'packfor'. It was installed once successfully, then uninstalled, and upon reinstallation...
install.packages("~/Downloads/packfor_0.0-8.tar.gz", repos = NULL, type = "source")
This error appears:
Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/packfor/libs/packfor.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/packfor/libs/packfor.so, 6): Symbol not found: ___addtf3
Referenced from: /usr/local/lib/libquadmath.0.dylib
Expected in: /usr/local/lib/libgcc_s.1.dylib
in /usr/local/lib/libquadmath.0.dylib
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/packfor’
Any ideas? If I force installation, packfor.so does exist in that directory.