Rcmdr Error : .onLoad failed in loadNamespace() for 'tcltk' - r

I have no idea what I'm doing but I need to use R and Rcmdr for my statistics class. I am running OS X 10.7.5, using 3.1.2 for R.
I have downloaded R.
install.packages("Rcmdr")
Picked a mirror, downloaded all packages. I then typed in
library(Rcmdr)
And received this error:
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: sandwich
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: system2("otool", c("-L", shQuote(DLL)), stdout = TRUE)
error: error in running command
Error: package or namespace load failed for ‘Rcmdr’
sh: otool: command not found
When I do:
capabilities("tcltk")
# [1] TRUE
Have I done something wrong?

The R developers have tried to make a workaround for R not giving a useful error message when Tcl/Tk was not fully supported on a Mac. It seems R 3.1.2 depends on the otool from Xtools for this. However, you can download a patched version of R from http://r.research.att.com/ to remove the error.

Related

rjags failed to load and R Failed to locate any version of JAGS

I am trying to use the package zoib and rjags. I have the latest version of R and have downloaded the latest version of JAGS as well.
Each time I install zoib and rjags it says it is successful but when I try to load them I get the following:
Error: package or namespace load failed for ‘rjags’:
.onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: Failed to locate any version of JAGS version 4
Error: package ‘rjags’ could not be loaded
Is this a problem with the library from which R is loading packages from? Is this a version compatibility issue? Please help.

R error loading package rJava and openNLP

I get this error message while trying to load the rJava or the openNLP packages through the function library(openNLP) or library(rJava):
Error: package or namespace load failed for ‘rJava’:
.onLoad in loadNamespace() for 'rJava' failed, details:
call: dirname(this$RuntimeLib)
error: a character vector argument expected
I have no problems loading other packages, e.g. NLP.
Does somebody know what the problem is?
I have updated the Java SE Development Kit and now I get no error message anymore. So this seems to be the solution for the problem.
I solved this problem by installing Java SE Development Kit 8.
Link for Download: http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html

rJava Package installation failed (needed for xlsx package)

When I want to install the xlsx package, I get this error :
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package ‘rJava’ could not be loaded
So I tried reinstalling rJava, but I get this :
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package or namespace load failed for ‘rJava’
Do you guys have any simple solution to this ? I am not very familiar with R, and I just need it to bootstrap some data.
I had the same error recently (R Error: JAVA_HOME cannot be determined from the Registry). I found the solution here. In brief, Joachim Schork identified the problem as not the xlsx package but rather the rjava package. He explained that the problem usually is, as hartmut said, running a 64 bit version of R and a 32 bit version of Java. To resolve the problem according to his recommendation, you need to download and install the 64 bit version of Java. In my case, the solution included installing Java on my machine as it was never installed previously.

Error when trying to load XLConnect Package

After updating to the latest version of Rstudio (R version 3.4.1 (2017-06-30) -- "Single Candle") I cannot seem to get the XLConnect Package to load. This is the error message I get:
> 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
R also throws a similar error message when I try to load the rJava package as well. I have tried uninstalling both Java and R and have scoured SO for answers, but nothing seems to work.
I am running macOS Sierra (10.12.6)
Would anyone be willing to offer any help?
The error suggests that there is an issue loading rJava. Try updating the Java configuration variables via R CMD javareconf or sudo R CMD javareconf.

Error: package ‘rJava’ could not be loaded when installing xlsx

Im trying to install the xlsx package. Installing works fine but when i load the library I get the following error:
> require(xlsx)
Loading required package: xlsx
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re- installing Java and make sure R and Java have matching architectures.
In addition: Warning messages:
1: package ‘xlsx’ was built under R version 3.2.3
2: package ‘rJava’ was built under R version 3.2.3
Failed with error: ‘package ‘rJava’ could not be loaded’
I googled around and say that installing the right version of Java might be the issue. However, when I downloaded the newest version and started a new r-session I still get the same issue.
Are there more people experiencing this issue? And some quick fix?
I am using Linux and when I update R or Java to use the rJava library (needed by xlsx) I need to run this commands form a shell (outside the R session)
sudo su -
R CMD javareconf
I hope this helps.

Resources