Error “.onLoad failed in loadNamespace() for 'tcltk'” - r

I'm pretty new to R in Ubuntu.
I am running R (3.5.0) in Rstudio 1.1.456 through Anaconda.
The operating system is Ubuntu 18.04.
In R studio I select the package Rcmdr:
> library("Rcmdr", lib.loc="~/anaconda3/envs/rstudio/lib/R/library")
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: carData
Loading required package: sandwich
Loading required package: effects
lattice theme set by effectsTheme()
See ?effectsTheme for details.
Error: package or namespace load failed for ‘Rcmdr’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/builddir/vendor/build/lib/tcl8.6 ./lib/tcl8.6 ./lib/tcl8.6 ./library ./library ./tcl8.6.5/library ./tcl8.6.5/library
This probably means that Tcl wasn't installed properly.
I then tried package tcltk by itself:
> library("tcltk", lib.loc="~/anaconda3/envs/rstudio/lib/R/library")
Error: package or namespace load failed for ‘tcltk’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/builddir/vendor/build/lib/tcl8.6 ./lib/tcl8.6 ./lib/tcl8.6 ./library ./library ./tcl8.6.5/library ./tcl8.6.5/library
This probably means that Tcl wasn't installed properly.
Following the question here:
Error ".onLoad failed in loadNamespace() for 'tcltk'"
> capabilities("tcltk")
tcltk
TRUE
Unfortunately the solution above only deals with the case where capabilities("tcltk") comes back with FALSE so I'm stuck at this point!
Also the package tk is showing as installed already in line with the suggestion by J_F in the comments to the original question:
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
Can someone please tell me how to resolve this.

Related

Problems installing tabulizer. error: JAVA_HOME cannot be determined from the Registry

I know there are a lot of questions on this issue. I have previously solved that problem with:
remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch")
but I have instaled R 4.2.1 in a new PC and I am not able to fix it this time,
I have succesfully installed rJava package but when I try above code I get this error:
Error: package or namespace load failed for 'tabulizerjars':
.onLoad failed in loadNamespace() for 'tabulizerjars', details:
call: NULL
error: .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
I have re-installed rJava several times but I keep getting the same error.
I would appreciate any help about it.

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.

Can't load the mailR package in R

I would like to load mailR package in both my local rStudio and one run off an ec2 server. I get this error:
> require(mailR)
Loading required package: mailR
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 message:
package ‘mailR’ was built under R version 3.3.3
If I try to load rJava I get:
> require(rJava)
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 message:
package ‘rJava’ was built under R version 3.3.2
Thank you for the help!

rJava access issue in R3.3.0 (Windows XP)

I need to use the package "xlsx" to export some data on R to excel, but that package requires rJava to run. Whenever I use library(rJava) to call rJava, I get the following error:
Error:.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package 'rJava' could not be loaded
I honestly cannot make heads or tails of it. What can I do to fix it?

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

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.

Resources