XLconnect R Package

XLConnect is a package that allows for reading, writing and manipulating Microsoft Excel files from within R.

Check my System Info

Sys.info()
##           sysname           release           version          nodename 
##         "Windows"          "10 x64"     "build 18362" "DESKTOP-59OHM3L" 
##           machine             login              user    effective_user 
##          "x86-64"           "neelo"           "neelo"           "neelo"

Install the package in R studio

install.packages("XLconnect")
library(XLconnect)

Initially I had Java version 13, which is not compatible so i a was getting this error (Figure 1)

knitr::include_graphics("error.JPG")
Error: Wrong Java Version Installed

Error: Wrong Java Version Installed

Check your R Version

R version

version
##                _                           
## platform       x86_64-w64-mingw32          
## arch           x86_64                      
## os             mingw32                     
## system         x86_64, mingw32             
## status                                     
## major          3                           
## minor          6.3                         
## year           2020                        
## month          02                          
## day            29                          
## svn rev        77875                       
## language       R                           
## version.string R version 3.6.3 (2020-02-29)
## nickname       Holding the Windsock
  • “mingw-w32” or “mingw-w64”

    • “mingw-w64” generate 64bit binaries that will run on windows natively (64bit windows required)
    • “mingw-w32” generate 32bit binaries that will run on windows natively

You can upgrade your R from Rstudio, if required

install.packages("installr")
library(installr)
updateR()

Check Your Java Version

A 64-bit program will see the information on 64-bit Java, and a 32-bit program will see information on 32-bit Java.

So make sure that you have Java SDK installed is of the same 64 or 32 bit as you R-program.

ON windows command line enter command java -version and it will tell you what you got for Java

knitr::include_graphics("error.JPG")
Error: Wrong Java Version Installed

Error: Wrong Java Version Installed

If you require to install JAVA, Go Here!

JAVA_HOME env Variable is set right

After java is installed, make sure that the environment variable JAVA_HOME is set right Check by entering following command

Sys.getenv("JAVA_HOME")
## [1] "C:\\Program Files\\Java\\jdk1.8.0_251"

Make sure the variable value is set right by browsing to it
and if its value is not set Set it by entering following command

Sys.setenv(JAVA_HOME = "C:\\Program Files\\Java\\jdkx.x.x_xxx")

You are good to go If + R and Java are both 32 bit or 64 bit + Java version is between 8 and 11 + JAVA_HOME Environment Variable is set right