Installing the XLConnect R Library on OS 10.8.2

XLConnect , as described in the manual, is "a package that allows you to read, write, and manipulate Microsoft Excel files from within R".

Installing on Windows and Linux is simple. Just say R on install.packages("XLConnect") and you install.packages("XLConnect") done. On OS X, you need to use install.packages("XLConnect", type="source") , as indicated in the installation instructions.

Attempting this in OS 10.8.2, R to output some error messages. I post them here, so Google can send people with similar problems to these Q and A. To solve the problem, scroll down.


Output R:

 > install.packages("XLConnect", type = "source") also installing the dependencies 'XLConnectJars', 'rJava' versuche URL 'http://ftp5.gwdg.de/pub/misc/cran/src/contrib/XLConnectJars_0.2-4.tar.gz' Content type 'application/x-gzip' length 16539227 bytes (15.8 Mb) URL geöffnet ================================================== downloaded 15.8 Mb versuche URL 'http://ftp5.gwdg.de/pub/misc/cran/src/contrib/rJava_0.9-3.tar.gz' Content type 'application/x-gzip' length 537153 bytes (524 Kb) URL geöffnet ================================================== downloaded 524 Kb versuche URL 'http://ftp5.gwdg.de/pub/misc/cran/src/contrib/XLConnect_0.2-4.tar.gz' Content type 'application/x-gzip' length 1719698 bytes (1.6 Mb) URL geöffnet ================================================== downloaded 1.6 Mb * installing *source* package 'rJava' ... ** Paket 'rJava' erfolgreich entpackt und MD5 Summen überprüft /Library/Frameworks/R.framework/Resources/bin/config: line 142: make: command not found /Library/Frameworks/R.framework/Resources/bin/config: line 143: make: command not found /Library/Frameworks/R.framework/Resources/bin/config: line 219: make: command not found /Library/Frameworks/R.framework/Resources/bin/config: line 142: make: command not found /Library/Frameworks/R.framework/Resources/bin/config: line 143: make: command not found /Library/Frameworks/R.framework/Resources/bin/config: line 219: make: command not found checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. ERROR: configuration failed for package 'rJava' * removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava' ERROR: dependency 'rJava' is not available for package 'XLConnectJars' * removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/XLConnectJars' ERROR: dependencies 'XLConnectJars', 'rJava' are not available for package 'XLConnect' * removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/XLConnect' Die heruntergeladenen Quellpakete sind in '/private/var/folders/some/path/to/downloaded_packages' Warnmeldungen: 1: In install.packages("XLConnect", type = "source") : Installation des Pakets 'rJava' hatte Exit-Status ungleich 0 2: In install.packages("XLConnect", type = "source") : Installation des Pakets 'XLConnectJars' hatte Exit-Status ungleich 0 3: In install.packages("XLConnect", type = "source") : Installation des Pakets 'XLConnect' hatte Exit-Status ungleich 0 > library(XLConnect) Fehler in library(XLConnect) : es gibt kein Paket namens 'XLConnect' 
+7
source share
1 answer

Installing on Mac OSX is a bit more complicated than the installation instructions . Martin Studer of Mirai Solutions, the developer of the package, helped me solve my difficulties, and I want to publish this procedure here to help other users, possibly facing the same problems.

  • Install java
    Due to security issues, the latest versions of OS X ship without Java. If you upgrade from Java, it will be deleted! Check if you have Java. If not, download and install it.
  • Install rJava
    You (later) install XLConnect from the source because there is no binary for OS X. During this installation process, you will receive an error message when R tries to install the dependent rJava package because it must be installed from a binary file. Therefore, you must first install it using install.packages("rJava")
  • Install XLConnect
    Finally, install XLConnect from the source:
    install.packages("XLConnect", type="source")
+7
source

All Articles