Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install library(xlsx) in R and look for an alternative

Tags:

r

xlsx

rjava

I use R version 3.0.3. I was not able to install library(xlsx). Error message:

Loading required package: rJava
Error : .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/R-3.0.3/library/rJava/libs/x64/rJava.dll':

LoadLibrary failure:  The specified module could not be found.

I then tried to install rjava on its own. Got the error message below:

library("rJava", lib.loc="C:/Program Files/R/R-3.0.3/library") Error : .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/R-3.0.3/library/rJava/libs/x64/rJava.dll': LoadLibrary failure: The specified module could not be found.

Is there another way to load excel file in R?

Thanks,

like image 486
PMa Avatar asked Apr 22 '14 02:04

PMa


People also ask

How do I install an xlsx library in R?

To install a package in R environment, we can execute the below command on the console of R: > install. packages("xlsx")

What is the package for xlsx in R?

xlsx package is one of the powerful R packages to read, write and format Excel files. It is a java-based solution and it is available for Windows, Mac and Linux.


1 Answers

This problem is generally caused by x86 vs x64 bit differences between the R session and the install Java edition. By default Java installs the x86 version and you have to search for the x64 version. if you look at the version of Java you have installed and then open your R session to the same if your using R studio you can click on Tools.GlobalOptions and then select the version you need. ;-)

like image 174
Robert AA Turnage Avatar answered Sep 23 '22 04:09

Robert AA Turnage