Can not load package tcltk in R [duplicate] - r

This question already has answers here:
Error ".onLoad failed in loadNamespace() for 'tcltk'"
(7 answers)
Closed 7 years ago.
I am trying to do multiple imputation in R and have installed Amelia and tried to open AmeliaView but it said require tcltk package. I proceeded to install tcltk but error message pop out as follows. Could someone help me?
> AmeliaView()
Loading required package: tcltk
Loading Tcl/Tk interface ... Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.5.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so
Reason: image not found
Error in AmeliaView() : The package 'tcltk' is required
> require(tcltk2)
Loading required package: tcltk2
Loading required package: tcltk
Loading Tcl/Tk interface ... Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.5.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so
Reason: image not found
Failed with error: ‘package 'tcltk' could not be loaded’

This might be useful for those having the same issue on Linux (long discussion, skip to the end to get the final solution):
http://r.789695.n4.nabble.com/Where-is-the-tcltk-package-td3434915.html

If your version of R > 3.0 then Tck/Tk 8.6.0 come bundles with it. You should be ok deleting it
See: http://cran.us.r-project.org/bin/macosx/tools/

Related

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!

‘rJava’ could not be loaded after installing R version 3.4

Loading required package: xml2
Loading required package: rJava
Loading required package: methods
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object
'/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/r Java.so
Reason: image not found
Error: package ‘rJava’ could not be loaded
Execution halted
I'm getting this error a day after I installed version 3.4 of R. I tried solutions from other pages but it didn't work. I can't run R scripts through the terminal but I run scripts on RStudio. I'm thinking that it might be a problem with paths, but I just wanted to double check here and confirm instead of getting myself into a deeper mess.

Issues with loading XLConnect library in R

I have installed XLConnect package though my R studio. When I try to load the library I get the following error
> library(XLConnect)
Loading required package: XLConnectJars
Error: package or namespace load failed for ‘XLConnectJars’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
Reason: image not found
Error: package ‘XLConnectJars’ could not be loaded
I checked the /Library/Frameworks/R.framework/Versions/3.4/Resources/library folder and I am noticed all three mentioned libraries(XLConnect, XLConnectJars, rJava) already present.

Error in installing "rgl" package in Yosemite 10.10.4

I get this message whenever I try to install rgl package on Yosemite 10.10.4
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.2/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so
Reason: image not found
Error: package or namespace load failed for ‘rgl’
How can I fix this?
Six years too late but for other people searching for a solution. The solution that worked for me is to download and install XQuartz https://www.xquartz.org
See Stackoverflow answers here and here

Can't install 'ks' package in R

I'm using R 3.0.2 and RStudio 0.98.945 for Mac.
Loading 'ks' package gives this error message.
Loading required package: rgl
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.0/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rgl/libs/r gl.so, 6): Library not loaded: /usr/X11/lib/libGLU.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/rgl/libs/rgl.so
Reason: image not found
Error: package ‘rgl’ could not be loaded
Loading 'rgl' package gives the same error message.
How can I solve this?

Resources