Error in installing R Package "SqlRender" - r

I am new to R - Programming, I am trying to run "install_github("ohdsi/SqlRender")" on windows 7, 64-bit with jdk 7 (64- bit) and R version 3.1.2 and R-GUI (64-bit).
I am getting the following error:
> library("devtools")
Warning message:
package ‘devtools’ was built under R version 3.1.3
> install_github("ohdsi/SqlRender")
Downloading github repo ohdsi/SqlRender#master
Installing SqlRender
"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" --no-site-file --no-environ --no-save -- no-restore CMD INSTALL \
"C:/Users/PPingali/AppData/Local/Temp/RtmpMtqVJl/devtools1318104472eb/OHDSI- SqlRender-cc551a2" \
--library="C:/Users/PPingali/Documents/R/win-library/3.1" --install-tests
* installing *source* package 'SqlRender' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
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/PPingali/Documents/R/win- library/3.1/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/PPingali/Documents/R/win-library/3.1/SqlRender'
Error: Command failed (1)
Please help me out in fixing this issue...
Thanks in advance.....
....................................................................
rJava package got installed perfectly...
when i run
library(rJava)
gives me no error.....

install.packages("SqlRender",INSTALL_opts = "--no-multiarch")
for some reason checks bost 32 and 64bit versions. even though I have correct x64 version of Java 1.8, R it still failed check i386 step. the INSTALL_opts flaf seems to bypass and then no issue

Related

Trouble with installing r2excel package in R

I am trying to install r2excel package in R via install_github but I get this error
> install_github("kassambara/r2excel")
several lines appearing in the console and I get
* installing *source* package 'r2excel' ...
** R
** preparing package for lazy loading
Warning: package 'xlsx' was built under R version 3.4.4
** help
*** installing help indices
converting help for package 'r2excel'
finding HTML links ... done
getOS html
r2excel-package html
xlsx.addHeader html
xlsx.addHyperlink html
xlsx.addLineBreak html
xlsx.addParagraph html
xlsx.addPlot html
xlsx.addTable html
xlsx.openFile html
xlsx.readFile html
xlsx.writeFile html
xlsx.writeMultipleData html
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning: package 'xlsx' was built under R version 3.4.4
Error: package or namespace load failed for 'xlsx':
.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 : package 'xlsx' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
Warning: package 'xlsx' was built under R version 3.4.4
ERROR: loading failed for 'i386'
* removing 'C:/Users/myusername/Documents/R/win-library/3.4/r2excel'
In R CMD INSTALL
Installation failed: Command failed (1)
So I get this error on 'xlsx' loading
What is weird is that I have no trouble loading 'xlsx' and 'rJava' individually with
library(xlsx)
I have a x64 java installed (build 1.8.0_161-b12) and a x64 rStudio running so I really don't know where the problem is coming from.
According to liuyanguu in https://github.com/kassambara/r2excel/issues/6:
"This package was not built in 64 bits system so we cannot install it this way. But you can still use all the functions by clone the repo and source or just copy-paste "/R/r2excel.r". There is actually no need to install the package."

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

Unable to install R package ranger

I was trying to manually install package 'ranger' on SUSE 11. I'm using sudo R CMD INSTALL ranger_0.8.0.tar.gz in the console and after some compilations messages I receive the following error. Any workaround?
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib64/R/library/ranger/libs/ranger.so':
/usr/lib64/R/library/ranger/libs/ranger.so: undefined symbol: __cxa_pure_virtual
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/ranger’
Additional details:
R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Platform: x86_64-suse-linux-gnu (64-bit)
gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195014]

Error in installing Tabulizer

Using the instructions described in github and installing Java accordingly with Chocolatey -- plus installing rJava and setting the path in R with Sys.setenv(JAVA_HOME = "C:/Program Files/Java/jdk1.8.0_131")-- I've done the following in R:
library(ghit)
library(git2r)
ghit::install_github(c("leeper/tabulizerjars", "leeper/tabulizer"), INSTALL_opts = "--no-multiarch", dependencies = c("Depends", "Imports"))
Which is the solution provided in this answer. I get the following error:
Error in git2r::init(d) :
Error in 'git2r_repository_init': Unable to init repository
Setting the option VERBOSE = TRUE in install_github I get the following additional output:
Parsing reponame for 'leeper/tabulizerjars'...
Creating local git repository for tabulizerjars in C:\Users\JOOCAR~1\AppData\Local\Temp\RtmpgnitDP\tabulizerjars1643e0126f5...
Error in git2r::init(d) :
Error in 'git2r_repository_init': Unable to init repository
I read this answer and it seems that it has to do with my username, which is spaced and has accents. But how do I configure this?
edit: 6/4/2017 1:57 am
Following user #jaySf answer, I run part of the code of his answer (since I've already installed rJava and devtools):
library(rJava) # load and attach 'rJava' now
devtools::install_github("ropensci/tabulizer", args="--no-multiarch")
And got the following error:
> library(rJava) # load and attach 'rJava' now
> devtools::install_github("ropensci/tabulizer", args="--no-multiarch")
Downloading GitHub repo ropensci/tabulizer#master
from URL https://api.github.com/repos/ropensci/tabulizer/zipball/master
Installing tabulizer
Downloading GitHub repo ropensci/tabulizerjars#master
from URL https://api.github.com/repos/ropensci/tabulizerjars/zipball/master
Installing tabulizerjars
"C:/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/Joo \
Caos/AppData/Local/Temp/Rtmpgh9eJi/devtoolsb3c50925145/ropensci-tabulizerjars-c6cc40e" --library="C:/R-3.4.0/library" --install-tests
* installing *source* package 'tabulizerjars' ...
** R
** 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 'tabulizerjars':
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/R-3.4.0/library/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/R-3.4.0/library/tabulizerjars'
Installation failed: Command failed (1)
"C:/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/Joo \
Caos/AppData/Local/Temp/Rtmpgh9eJi/devtoolsb3c4a2835ec/ropensci-tabulizer-a38d957" --library="C:/R-3.4.0/library" --install-tests --no-multiarch
ERROR: dependency 'tabulizerjars' is not available for package 'tabulizer'
* removing 'C:/R-3.4.0/library/tabulizer'
Installation failed: Command failed (1)
I believe that I might have a problem with my username in the file directory path, but I'm not sure. I tried using install_github with ggplot2 --`install_github("wch/ggplot2") -- and it worked fine. If my guess is correct, how can I edit the file path?
Problem solved
I was running R with both 32 bit and 64 bit files installed. I cannot clearly state what were the problems in doing this, since as I ran Sys.getenv("R_ARCH") it returned x64 previously, but when I uninstalled the 32 bit files, it ran perfectly well with #jaySf code.
Follow these steps in given order should work:
install.packages("rJava")
library(rJava) # load and attach 'rJava' now
install.packages("devtools")
devtools::install_github("ropensci/tabulizer", args="--no-multiarch")
I'm using R 3.4.0 on win64, and described the procedure in a former answer.
install.packages("rJava")
library(rJava) # load and attach 'rJava' now
install.packages("devtools")
#run below package first..
devtools::install_github("ropensci/tabulizerjars", args="--no-multiarch")
devtools::install_github("ropensci/tabulizer", args="--no-multiarch")
You might try:
devtools::install_github("ropensci/tabulizerjars", INSTALL_opts = c("--no-multiarch"))
devtools::install_github("ropensci/tabulizer", INSTALL_opts = c("--no-multiarch"))

.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