Install R package - FSELCETOR on SUSElinux server - r

I have an account to Suse linux server, without root access.
I have installed an R , and now I want to use FSELECTOR package.
I have started with this steps:
$ whereis java
java: /usr/bin/java /usr/lib64/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
$ R CMD javareconf -e
$unset JAVA_HOME
And then I have started R
Sys.setenv(JAVA_HOME='\\usr\\lib64\\java\\)
install.packages("FSelector")
During the installation process I have got this message:
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/rJava’
ERROR: dependency ‘rJava’ is not available for package ‘RWekajars’
* removing ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/RWekajars’
ERROR: dependencies ‘RWekajars’, ‘rJava’ are not available for package ‘RWeka’
* removing ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/RWeka’
ERROR: dependency ‘RWeka’ is not available for package ‘FSelector’
* removing ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/FSelector’
Any Ideа?
I want to install rJava, but i have got the same result.
Sys.setenv(JAVA_HOME='\\usr\\lib64\\jvm\\java-10-openjdk-10')
install.packages("rJava")
Installing package into ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
......
4 warnings
make[1]: Leaving directory '/tmp/RtmpTkyyj5/R.INSTALLb60f4541cb34/rJava/jri'
installing via 'install.libs.R' to /home/korosig/R/x86_64-suse-linux-gnu-library/3.5/rJava
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/korosig/R/x86_64-suse-linux-gnu-library/3.5/rJava’
The downloaded source packages are in
‘/tmp/RtmpcwM6XO/downloaded_packages’
Warning message:
In install.packages("rJava") :
installation of package ‘rJava’ had non-zero exit status

To install FSelector you need this [debian]
sudo apt-get install -y r-cran-randomforest
sudo apt-get install -y default-jre
sudo apt-get install -y default-jdk
sudo R CMD javareconf

Related

CentOS7 using R to install clusterProfiler get error about openssl

I've been having an unresolved error when I installed clusterProfiler using R on CentOS7. I have checked the information and some of them say it is the reason for installing the openssl version at the same time, but I have not found a specific solution.
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/00LOCK-openssl/00new/openssl/libs/openssl.so':
libssl.so.1.1: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/openssl’
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/usr/lib64/R/library/httr’
ERROR: dependency ‘httr’ is not available for package ‘europepmc’
* removing ‘/usr/lib64/R/library/europepmc’
ERROR: dependency ‘europepmc’ is not available for package ‘enrichplot’
* removing ‘/usr/lib64/R/library/enrichplot’
ERROR: dependency ‘enrichplot’ is not available for package ‘clusterProfiler’
* removing ‘/usr/lib64/R/library/clusterProfiler’
do this operation can solve the problem:
yum install openssl-devel
yum info openssl-devel
pkg-config --modversion openssl

I am trying to install openssl package in R using Ubuntu 18.04 without success

I try to install the Openssl package in R (using RStudio in Ubuntu 18.04), but I get the error "undefined symbol: RSA_pkey_ctx_ctrl":
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/danilo/R/x86_64-pc-linux-gnu-library/3.4/openssl/libs/openssl.so':
/home/danilo/R/x86_64-pc-linux-gnu-library/3.4/openssl/libs/openssl.so: undefined symbol: RSA_pkey_ctx_ctrl
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/danilo/R/x86_64-pc-linux-gnu-library/3.4/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status.
I have already tried to install through both RStudio and Terminal, but as I am relatively new to Ubuntu, I did not have any success. I have the tar.gz file downloaded, but I don't know what should I do with it.
I actually want to use packages httr and ggmap, but they both require openssl.
Try in terminal:
sudo apt-get install libssl-dev
and after that try to install package openssl in R again.

Error : package 'rJava' could not be loaded but library(rJava) is working

I've 64 bit machine and have installed jdk and jre(64 bit) also R and R studio is 64bit. I'm trying to install 'rMongodb' package by:
devtools::install_github("tc/RMongo")
but it gives out error
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:/Users/saini/OneDrive/Documents/R/win-library/3.5/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
Warning: package 'rJava' was built under R version 3.5.2
ERROR: loading failed for 'i386'
* removing 'C:/Users/saini/OneDrive/Documents/R/win-library/3.5/RMongo'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/saini/AppData/Local/Temp/RtmpuEHfqO/file20f419985c01/RMongo_0.1.0.tar.gz’ had non-zero exit status
Even though library(rJava) works fine.
Ps. I've already set the environment variables.

coreNLP & rJava installation issue from gitbub in R

fellow stackoverflowers!
I was trying to install coreNLP from github as there is a bug in the coreNLP package that comes with R.
Now while installing the coreNLP from github using below
To download the R library and corresponding CoreNLP java library, run the following in R:
devtools::install_github("statsmaths/coreNLP")
coreNLP::downloadCoreNLP()
I got an error
installing source package 'coreNLP' ...
** R
** data
* moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** testing if installed package can be loaded
* arch - i386
Error: package or namespace load failed for 'coreNLP':
.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.
Error: loading failed
Execution halted
* arch - x64
ERROR: loading failed for 'i386'
removing 'C:/Users/animshru/Documents/R/win-library/3.4/coreNLP'
Installation failed: Command failed (1)
After looking at many suggestions what I understood was
i) I was missing the class file path for Java Home and added the same and tried installing coreNLP again.
Sys.setenv(JAVA_HOME='C:/Program Files/Java/jre1.8.0_121')
devtools::install_github("statsmaths/coreNLP")
This time the error generated relates to the package/library rJava as seen below
Downloading GitHub repo statsmaths/coreNLP#master
from URL https://api.github.com/repos/statsmaths/coreNLP/zipball/master
Installing coreNLP
"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/XYZ/AppData/Local/Temp/RtmpieUxG6/devtools3c0456877ca/statsmaths-coreNLP-caee22e" \
--library="C:/Users/XYZ/Documents/R/win-library/3.4" --install-tests
installing source package 'coreNLP' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
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/XYZ/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
ERROR: lazy loading failed for package 'coreNLP'
* removing 'C:/Users/XYZ/Documents/R/win-library/3.4/coreNLP'
Installation failed: Command failed (1)
I have installed the rJava package successfully and able to access the library for the same. Now I need to understand why I am getting this error of access issue to a rjava.dll file inside the package rJava.?
Has anyone encountered the same problem already??
I have double and triple checked the java version is 64bit same as the R.
Any hints folks??
Thanks

.onLoad failed in loadNamespace() for 'rClr'

I am trying to build a package which has the namespace files as follows:
exportPattern("^[[:alpha:]]+")
importFrom(rClr, clrLoadAssembly)
rClr is installed in my system.
I build my package using devtools::build and it successfully builds.
When I install the package using the following command install.packages("C:/Package/Utils_0.1.0.tar.gz", repos = NULL, type = "source")
I get the following error:
* installing *source* package 'Utils' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error : .onLoad failed in loadNamespace() for 'rClr', details:
call: fun(libname, pkgname)
error: 'msvcr120.dll' was not found on this Windows system.
You are probably missing the Visual C++ Redistributable for Visual Studio 2013.
Check instructions at https://r2clr.codeplex.com/wikipage?title=Installing%20R%20packages&referringTitle=Documentation
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/S.Bista/Documents/R/R-3.3.2/library/Utils'
* restoring previous 'C:/Users/S.Bista/Documents/R/R-3.3.2/library/Utils'
Warning in install.packages :
running command '"C:/Users/S~1.BIS/DOCUME~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\S.Bista\Documents\R\R-3.3.2\library" "C:/Package/Utils_0.1.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Package/Utils_0.1.0.tar.gz’ had non-zero exit status
Loading fails for i386 but I have x64 system.

Resources