Esssse
Esssse

Reputation: 51

How to install 'XLConnect'-package in R correctly

I am very new to this community. My aim is to use R for statistical analysis but some errors occurred.

In the first step, I want to load the "XLConnect"-package, in order to open an xlsx-data file, with this code:

install.packages('XLConnect') library(XLConnect)

Answer was "package ‘XLConnect’ successfully unpacked and MD5 sums checked", after which the following error was given:

Error in library(XLConnect) : the package ‘XLConnect’ doesn't exist.

I also tried the xlsx package, but in this case always got:

Error in -library('openxlsx') : invalid argument to unary operator

or, that the package openxlsx, doesn't exist but some line before it told me the download, installation and check sums were correct!

Additionally, when I try to change the directory in a script, using getwd(), the following error occurs:

Error in -getwd() : invalid argument to unary operator

When I type it in the console it works.

I downloaded R here: https://cran.r-project.org/bin/windows/base, installed R version 3.4.3 as well as R Studio. I already looked in the community for some hints but neither could solve my problem:

MY OS is Windows 10, I tried the 32-bit as well as the 64-bit version of R and installed fitting Java-Versions for both verisons( that was the first error that occured but now isn't there anymore).

I tried to load the packages from several CRAN-Mirrors but always the same error occurs (e.g. Germany(Göttingen),Germany(Münster), Belgium(Ghent) or Switzerland ). Maybe I missed some very basic setting. Is the information I provided enough or do you need more?

Thanks a lot in advance for your support!

Upvotes: 0

Views: 9691

Answers (2)

Esssse
Esssse

Reputation: 51

Thanks a lot! I installed java 32-bit and 64-bit versions the way it is recommended here: https://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/ and I installed the rJava package like this: install.packages("rJava") library(rJava) and here: https://askubuntu.com/questions/176115/what-is-the-best-way-of-installing-the-r-package-xlconnect I found that this here should work to register R correctly: sudo R CMD javareconf but then I get the error that the console got an unexpected symbol. Or Do you know how to register Java Development Kit in R correctly. I installed jdk-8u161-windows-x64.

Upvotes: 1

Archie
Archie

Reputation: 1

Make sure you have Java Development Kit installed and correctly registered in R.

Upvotes: 0

Related Questions