R: Error message installing a package, how to get around it? - r

I am having an error installing XLConnect for R, this is the error message I get:
> install.packages("XLConnect")
Installing package into ‘C:/Users/a_garcia_de_paredes/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/XLConnect_0.2-13.zip'
Content type 'application/zip' length 9633752 bytes (9.2 MB)
downloaded 9.2 MB
package ‘XLConnect’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\a_garcia_de_paredes\AppData\Local\Temp\RtmpKA18my\downloaded_packages
> library("XLConnect")
Loading required package: XLConnectJars
Error: package or namespace load failed for ‘XLConnectJars’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package ‘XLConnectJars’ could not be loaded
Is there a way to get around it?

Related

The package Rmpi is already installed, but R returns "Loading required package: Rmpi"

I'm trying to run parallel computing. Hence I install package Rmpi.
install.packages("Rmpi")
require("Rmpi")
Could you please elaborate why there is such error message while I've just installed the package?
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into �C:/Users/Dung Le/Documents/R/win-library/4.0�
(as �lib� is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Rmpi_0.6-9.zip'
Content type 'application/zip' length 353588 bytes (345 KB)
downloaded 345 KB
package ‘Rmpi’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Dung Le\AppData\Local\Temp\RtmpGm7Riu\downloaded_packages
Loading required package: Rmpi
Error: package or namespace load failed for �Rmpi�:
.onLoad failed in loadNamespace() for 'Rmpi', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/Dung Le/Documents/R/win-library/4.0/Rmpi/libs/x64/Rmpi.dll':
LoadLibrary failure: The specified module could not be found.
PS: I use Windows 10 Pro with version 2004 and build 19041.508. My R is 4.0.2.

.onLoad failed in loadNamespace() for 'rJava [duplicate]

This question already has answers here:
"unable to load shared object" when loading the rJava library
(2 answers)
Closed 3 years ago.
I am running Win 10 64-bi with Java version 1.8.0.221. when loading xlsx package I am getting an error in R Studio with version 3.5.2 - also 64-bit.
The error is in loading rJava.
any thoughts on how can I fix this? I am stuck and can't move forward. Thanks.
trying URL 'https://mran.microsoft.com/snapshot/2019-02-01/bin/windows/contrib/3.5/xlsx_0.6.1.zip'
Content type 'application/zip' length 458979 bytes (448 KB)
downloaded 448 KB
package ‘xlsxjars’ successfully unpacked and MD5 sums checked
package ‘xlsx’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\<user>\AppData\Local\Temp\RtmpIZaYPe\downloaded_packages
> library(xlsx)
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/<user>/Documents/R/win-library/3.5/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
I added the following and then rJava loaded without error.
Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre1.8.0_221')

error in R while installing packages: problems with shiny or java_home? is it due to opensteetmap?

I'm new with R unfortunately, but i need it to open a specific file which should be a graphical user interface.
After the source command:
source("D:\\R\\win-library\\3.5\\muxViz-master\\muxVizGUI.R")
I'm facing this error:
"Installing package into ‘D:/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning: package ‘shiny’ is in use and will not be installed
Carico il pacchetto richiesto: OpenStreetMap
Error: package or namespace load failed for ‘OpenStreetMap’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Installing package into ‘D:/R/win-library/3.5’
(as ‘lib’ is unspecified)
provo con l'URL 'https://cran.stat.unipd.it/bin/windows/contrib/3.5/OpenStreetMap_0.3.3.zip'
Content type 'application/zip' length 2264648 bytes (2.2 MB)
downloaded 2.2 MB
package ‘OpenStreetMap’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Camla\AppData\Local\Temp\RtmpE9NQB2\downloaded_packages
Error in shinyAppDir(x) : App dir must contain either app.R or server.R.".
The contents of this directory come from http://github.com/manlius/muxViz.
Please help.
The last line of muxVizGUI.R is runApp(getwd()). It expects that your working directory is the same directory in which the ui.R and server.R files are located. You should change to that directory before sourcing the file:
setwd("D:\\R\\win-library\\3.5\\muxViz-master")
source("muxVizGUI.R")

Unable to load RJDBC package in RStudio

I have successfully installed the RJDBC in RStudio.
install.packages("RJDBC")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/RJDBC_0.2-7.zip'
Content type 'application/zip' length 70232 bytes (68 KB)
downloaded 68 KB
package ‘RJDBC’ successfully unpacked and MD5 sums checked
However when I load RJDBC on Windows 7 64-bit. However I get the following error.
The downloaded binary packages are in
C:\Users\abhish\AppData\Local\Temp\Rtmp0oCqXi\downloaded_packages
> library(RJDBC)
Loading required package: rJava
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Program Files/R Foundation/R/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified path is invalid.
Error: package ‘rJava’ could not be loaded
In addition: Warning messages:
1: package ‘RJDBC’ was built under R version 3.4.3
2: package ‘rJava’ was built under R version 3.4.3

Error (as ‘lib’ is unspecified) to install rjava

I am installing rJava on a 64bit machine, running Windows 7, and am encountering the weirdest message. Below is the log. Has anyone seen this before? Thanks in advance.
install.packages("rJava")
Installing package into ‘C:/Users/laila.rothe/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-6.zip'
Content type 'application/zip' length 761928 bytes (744 KB)
downloaded 744 KB
package ‘rJava’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\laila.rothe\AppData\Local\Temp\RtmpmcecQy\downloaded_packages
library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/laila.rothe/Documents
R/win-library/3.2/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
Error: package or namespace load failed for ‘rJava’

Resources