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

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.

Related

R installation won't let me open packages library issue

Hi so I'm having trouble with R studios on my desktop where it won't let me open any packages.
When I attempt to install a package with install.packages() like Tidyverse I get this error.
Error in library("tidyverse") : there is no package called ‘tidyverse’
Show in New Window Error in install.Rtools() : could not find function
"install.Rtools" Show in New Window 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/athen/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)
trying URL
'https://cran.rstudio.com/bin/windows/contrib/4.1/tidyverse_1.3.1.zip'
Content type 'application/zip' length 430128 bytes (420 KB) downloaded
420 KB
Then when I try to load the package into my library with library("tidyverse") I receive this error
Error: package or namespace load failed for ‘tidyverse’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
This error isn't just for tidyverse but all packages I try to run. I have uninstalled R and RStudios multiple times, but the error doesn't go away. I have been to IT at my university and they were completely baffled. Please help if you can, I really need R to work for both my job and classes.

rstan packages install from github

i dont know why i have this error.
since i had aleardy set all of the environment variable, rtools, r, rstudio and home path to D:\DANNY HUANG\Documents correctly
p.s. i set the installation program's path to D disk since i don't have enough space in OS disk,
> install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
trying URL 'https://cloud.r-project.org/bin/windows/contrib/4.0/rstan_2.21.2.zip'
Content type 'application/zip' length 5225165 bytes (5.0 MB)
downloaded 5.0 MB
package ‘rstan’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\DANNY HUANG\AppData\Local\Temp\Rtmp2D2Wbi\downloaded_packages
>example(stan_model, package = "rstan", run.dontrun = TRUE)
Loading required package: StanHeaders
Loading required package: ggplot2
Error: package or namespace load failed for ‘rstan’:
.onLoad failed in loadNamespace() for 'processx', details:
call: loadNamespace(name)
error: there is no package called ‘ps’

.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')

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

R connect to Oracle - library(ROracle) fail

It won't load the library.
setwd("C:/Users/***/Desktop")
install.packages('ROracle_1.2-1.zip', repos = NULL)
#Installing package into ‘C:/Users/***/Documents/R/win-library/3.3 (as ‘lib’ is unspecified)
#package ‘ROracle’ successfully unpacked and MD5 sums checked
library('ROracle')
#Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Users/***/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll': LoadLibrary failure: The specified module could not be found.
I manually checked the file path and ROracle.dll is there.
EDIT:
I have RODBC and RJDBC working. I just don't understand why ROracle won't install:
library(ROracle)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/robsoo01/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll':
LoadLibrary failure: The specified module could not be found.
Error: package or namespace load failed for ‘ROracle’
install.packages("ROracle")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘ROracle’
trying URL 'https://cran.rstudio.com/src/contrib/ROracle_1.2-2.tar.gz'
Content type 'application/x-gzip' length 304229 bytes (297 KB)
downloaded 297 KB
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
ERROR: cannot find Oracle Client.
Please set OCI_LIB64 to specify its location.
Warning: running command 'sh ./configure.win' had status 1
ERROR: configuration failed for package 'ROracle'
* removing 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
* restoring previous 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\***\Documents\R\win-library\3.3" C:\Users\***\AppData\Local\Temp\RtmpMvcLO4/downloaded_packages/ROracle_1.2-2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ROracle’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\***\AppData\Local\Temp\RtmpMvcLO4\downloaded_packages’
I'm guessing there are Oracle files that need installing, but none of the documentation is very clear.
In order for ROracle to install and load properly, you should have Oracle Client 64-bit and Windows 64-bit. Once I installed 64-bit Oracle Client on my machine, this error went away.

Resources