A warning message when running R program - r

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?

Related

Unable to load library tesseract in R

library(tesseract) # for OCR
Results in error:
Error: package or namespace load failed for ‘tesseract’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/dhlib/tesseract/libs/tesseract.so':
libtesseract.so.4: cannot open shared object file: No such file or directory
In addition: Warning message:
package ‘tesseract’ was built under R version 4.0.5
Any ideas on how to solve this?

Unable to load RWeka package

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!

error message trying to install homals package in R

I'm trying to install the Homals package - library(homals), but keep getting this error message:
library(homals)
Error : .onLoad failed in loadNamespace() for 'rgl', details: call:
dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared
object
'/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so,
6): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from:
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so
Reason: image not found Error: package or namespace load failed for
‘homals’
I have a couple of my colleagues to run the same code, the same thing happens. I have re-install R studio to the newest version.
install.packages("rgl")
install.packages("homals")
library(homals)
Any solutions for this? thank you.
I was able to successfully install on both Windows and Mac. I believe the root cause here is that you have R version 3.3 installed when you require at least v3.5.3 as per below:
library(homals)
Warning message:
package ‘homals’ was built under R version 3.5.3

rgl install failure in Rstudio on mac

rgl installed
Error : .onLoad failed in loadNamespace() for 'rgl', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so
Reason: image not found
Warning message:
In pacman::p_load(rgl) : Failed to install/load:
rgl
You don't really post a question (hence the negative scores others have given you), but it appears that the error message is telling you that rgl is failing to load because libGLU.1.dylib is not found.
You can probably fix this by installing XQuartz, since it looks like you're on a Mac. Go to https://www.xquartz.org to get it.

Calling R from Matlab

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

Resources