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."
Related
I want to install a package that is not found in CRAN.
Below is a downloadlink to the package.
The package makes use of JAGS, of which i have the 64 bit 4.3.0 version of.
rjags and r2jags packages are installed. Rtools is connected to the pathway. I checked this using
Sys.which("make")
## "C:\\rtools40\\usr\\bin\\make.exe"
Connection to path was done with devtools from this Stacklink:
How to add Rtools\bin to the system path in R
I use the following code to install the downloaded .tar.gz package:
install.packages("C:/Program Files/R/R-3.6.3/Liszt_0.8-5_1.tar.gz", repos=NULL,
type="source")
The package won't installl, instead i get the following error:
* installing *source* package 'Liszt' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'Liszt'
finding HTML links ... done
A3ModelFun html
A5ModelFun html
Caterpillar html
LL html
Liszt-package html
extract html
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rjags':
.onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: Failed to locate any version of JAGS version 4
The rjags package is just an interface to the JAGS library
Make sure you have installed JAGS-4.x.y.exe (for any x >=0, y>=0) from
http://www.sourceforge.net/projects/mcmc-jags/files
Error : package 'rjags' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/Sneve/Documents/R/win-library/3.6/Liszt'
Warning in install.packages :
installation of package ‘C:/PROGRA~1/R/R-36~1.3/Liszt_0.8-5_1.tar.gz’ had non-zero exit status
I am trying for a while no, but no success. Any help is much appreciated.
Website providing the package:
http://www.possinghamlab.org/2016-05-30-04-33-10/list-length-analysis.html
package is available here:
http://www.possinghamlab.org/images/LLA/Liszt_0.8-5_1.tar.gz
I installed the 64 Bit version of JAGS. Appearently, the package needs both the 32 and the 64 bit version installed on the PC to be able to work. After i installed also the 32 bit version of JAGS, package installed with no problem.
I have a line of code to capture the output of the version of Java installed:
version <- system2("java","-version", stdout=TRUE)
However, if I include that line of code when creating a package in the .onLoad function, I run into a problem when building.
.onLoad <- function(libname, pkgname){
version <- system2("java","-version", stdout=TRUE)
if(length(version)==0){
stop("Missing version")
}
}
Using the default RStudio "Clean and Rebuild", I can see both that the output is shown in the command line (the Java parts), and that the code then has the error showing the output was length 0:
==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source testpackage
* installing to library 'C:/Users/JNolis2/Documents/R/win-library/3.5'
* installing source package 'testpackage' ...
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'testpackage'
finding HTML links ... hello html
done
** building package indices
** testing if installed package can be loaded
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Error: package or namespace load failed for 'testpackage':
.onLoad failed in loadNamespace() for 'testpackage', details:
call: fun(libname, pkgname)
error: Missing version
Error: loading failed
Execution halted
ERROR: loading failed
removing 'C:/Users/JNolis2/Documents/R/win-library/3.5/testpackage'
In R CMD INSTALL
Exited with status 1.
How can I ensure the output is captured even during this step?
I tried installing xlsx package in R.
install.packages("xlsx")
installing *source* package 'xlsx' ...
** package 'xlsx' successfully unpacked and MD5 sums checked
** R
** inst
** 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: 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/hi/Documents/R/win-library/3.3/xlsx'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\hi\Documents\R\win-library\3.3" C:\Users\hi\AppData\Local\Temp\RtmpSGp15V/downloaded_packages/xlsx_0.6.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘xlsx’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\hi\AppData\Local\Temp\RtmpSGp15V\downloaded_packages’
Then I ran the library function too
library(xlsx)
Error in library(xlsx) : there is no package called ‘xlsx’
To ensure that whether the package has been installed itself or not I ran
grepl("xlsx",installed.packages())
# It returns "FALSE" 649 times in a row.
I read online about how some rjava packages need to be installed as well so I tried to
install.packages('rJava')
install.packages("xlsxjars")
package ‘rJava’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hi\AppData\Local\Temp\RtmpSGp15V\downloaded_packages
To ensure grepl("rJava",installed.packages())
Again I got "FALSE" 649 times.
I recently had a similar problem with another package and have had loads of headaches with R and Java integration. My understanding is that you have to install Java for each architecture you're using. If R is trying to install xlsx for both architectures and you've only got the 64-bit java installed, it would cause a failure like the one you got. You could try:
install.packages("xlsx", INSTALL_opts=c("--no-multiarch"))
This would keep it from trying to install the xlsx for the 32-bit architecture.
I had the same problem a few months ago. In my case, the solution was installing both versions of java (32-bit and 64-bit architecture). On windows 10 the 32-bit architecture should be installed on path ./programfiles (x86)/... and the 64-bit architecture should be installed on ./programfiles/... Both java installer can be found on the official web page.
After installing both architectures of java, it is necessary to make sure that JAVA HOME environtment is declared as empty string. Sys.getenv("JAVA HOME") = "".
This steps works for me. I hope that my solution works for you.
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
Im trying to install the xlsx package. Installing works fine but when i load the library I get the following error:
> require(xlsx)
Loading required package: xlsx
Loading required package: rJava
Error : .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.
In addition: Warning messages:
1: package ‘xlsx’ was built under R version 3.2.3
2: package ‘rJava’ was built under R version 3.2.3
Failed with error: ‘package ‘rJava’ could not be loaded’
I googled around and say that installing the right version of Java might be the issue. However, when I downloaded the newest version and started a new r-session I still get the same issue.
Are there more people experiencing this issue? And some quick fix?
I am using Linux and when I update R or Java to use the rJava library (needed by xlsx) I need to run this commands form a shell (outside the R session)
sudo su -
R CMD javareconf
I hope this helps.