R connect to Oracle - library(ROracle) fail - r

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.

Related

Cannot install tmap tmaptools, Error unable to load shared object lwgeom.so': libproj.so.19

I cannot install the R packages tmaptools and tmap in ubuntu linux, I have followed the instructions in
https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/
I installed sf and checked:
library(sf)
Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
Warning messages:
1: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
2: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
When I try to instal tmaptools the following error appears
> install.packages("tmaptools")
Installing package into ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/tmaptools_3.1-1.tar.gz'
Content type 'application/x-gzip' length 40116 bytes (39 KB)
==================================================
downloaded 39 KB
* installing *source* package ‘tmaptools’ ...
** package ‘tmaptools’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/lwgeom/libs/lwgeom.so':
libproj.so.19: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘tmaptools’
* removing ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
I have already removed the package and installed it again, but I always get the same error.
Browsing the tmap issues on github I found the answer:
install lwgeom package, so
install.packages("lwgeom")
Solved the problem.

CentOS install R package RLumShiny failed

I tried to install the shiny related package RLumShiny on the server.
System Version: CentOS Linux release 8.1.1911 (Core)
I tried to use :
install.packages("RLumShiny")
Some errors were returned. But I can't find these errors now.
And then i tired to use :
wget https://cran.r-project.org/bin/macosx/contrib/4.1/RLumShiny_0.2.2.tgz
R CMD INSTALL RLumShiny_0.2.2.tgz
R
library("RLumShiny")
The server reported an error:
>library(RLumShiny)
Error: package or namespace load failed for ‘RLumShiny’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so':
/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so: invalid ELF header
Then i tried :
>install.packages("RLumShiny")
Installing package into ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
try open URL'https://mirror-hk.koddos.net/CRAN/src/contrib/RLumShiny_0.2.2.tar.gz'
Content type 'application/x-gzip' length 448539 bytes (438 KB)
==================================================
downloaded 438 KB
installing *source* package ‘RLumShiny’ ...
package ‘RLumShiny’ successfully unpacked and MD5 sums checked
using staged installation
R
inst
byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so':
/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so: invalid ELF header
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘RLumShiny’
* removing ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/RLumShiny’
* restoring previous ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/RLumShiny’
The downloaded source packages are in
‘/tmp/RtmpZxd0sL/downloaded_packages’
Warning message:
In install.packages("RLumShiny") :
installation of package ‘RLumShiny’ had non-zero exit status
How can this be fixed?
The problem is clearly with the terra package. So the way to fix it would be to (re-) install that package first; perhaps after installing its system requirements (see the repo) perhaps with
sudo dnf install gdal-devel proj-devel geos-devel sqlite-devel

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.

Not able to install RWeka

I am facing issues while installing the RWeka package. I tried installing rJava but even that is not being installed, can someone help here with the issue? You can follow the code for the error message
> install.packages("RWeka")
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/1911120/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
RWeka 0.4-42 0.4-43 FALSE
installing the source package ‘RWeka’
trying URL 'https://cran.rstudio.com/src/contrib/RWeka_0.4-43.tar.gz'
Content type 'application/x-gzip' length 451318 bytes (440 KB)
downloaded 440 KB
* installing *source* package 'RWeka' ...
** package 'RWeka' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** R
** inst
** byte-compile and prepare package for lazy loading
Error: .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Execution halted
ERROR: lazy loading failed for package 'RWeka'
* removing 'C:/Users/1911120/Documents/R/win-library/3.6/RWeka'
Warning in install.packages :
installation of package ‘RWeka’ had non-zero exit status

How to fix the installation error with 'car' package

I am getting the below error while trying to install the 'car' package in R. Is there anything wrong I am doing here?
trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-2.tar.gz'
Content type 'application/x-gzip' length 447952 bytes (437 KB)
downloaded 437 KB
* installing source package 'car' ...
** package 'car' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Warning: package 'carData' was built under R version 3.5.2
Warning in fun(libname, pkgname) :
bytecode version mismatch; using eval
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/33904/Documents/R/win-library/3.3/data.table/libs/x64/datatable.dll':
LoadLibrary failure: The specified procedure could not be found.
ERROR: lazy loading failed for package 'car'
* removing 'C:/Users/33904/Documents/R/win-library/3.3/car'
* restoring previous 'C:/Users/33904/Documents/R/win-library/3.3/car'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\33904\Documents\R\win-library\3.3" C:\Users\33904\AppData\Local\Temp\Rtmpm23nOy/downloaded_packages/car_3.0-2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘car’ had non-zero exit status

Resources