在OS 10.8.2上安装R库XLConnect [英] Installing R library XLConnect on OS 10.8.2

查看:115
本文介绍了在OS 10.8.2上安装R库XLConnect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XLConnect 是一个允许从R内读取,写入和操作Microsoft Excel文件的软件包.

XLConnect is, as the manual describes it, "a package that allows for reading, writing and manipulation of Microsoft Excel files from within R".

在Windows和Linux上的安装非常简单.只需将R告诉install.packages("XLConnect"),就可以完成.在OS X上,您需要使用install.packages("XLConnect", type="source"),安装说明如下.

Installation on Windows and Linux is straightforward. Simply tell R to install.packages("XLConnect"), and you're done. On OS X you need to use install.packages("XLConnect", type="source"), the installation instructions say.

在OS 10.8.2下尝试此操作,R输出许多错误消息.我将其发布在此处,以便Google可以将与此问题类似的人发送给该问答.要解决此问题,请向下滚动.

Trying this under OS 10.8.2, R output a number of error messages. I post them here, so Google can send people with similar problems to this Q and A. For a solution to the problem, scroll down.

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’

推荐答案

在Mac OSX上进行安装比

Installation on Mac OSX is a tiny bit more complicated than the installation instructions suggest. Martin Studer at Mirai Solutions, the developer of the package, helped my solve my difficulties, and I want to post the procedure here to help other users possibly encountering the same problems.

  1. 安装Java
    出于安全考虑,最新版本的OS X不含Java.如果您使用Java版本进行更新,则该版本将被卸载!
    检查(如果您有Java).如果没有,请下载并安装它.
  2. 安装rJava
    您将(稍后)从源安装XLConnect,因为OS X没有二进制文件.在此安装过程中,R尝试安装从属软件包rJava时,您会收到错误消息,因为必须从二进制文件中进行安装.因此,您必须先使用
    install.packages("rJava")
  3. 安装它
  4. 安装XLConnect
    最后,从源代码安装XLConnect:
    install.packages("XLConnect", type="source")
  1. Install Java
    Due to security concerns, recent versions of OS X come without Java. If you updated from a version with Java, it will have been uninstalled! Check, if you have Java. If not, download and install it.
  2. Install rJava
    You will (later) install XLConnect from source, because there is no binary for OS X. During this installation process, you will get an error, when R tries to install the dependent package rJava, because this must be installed from the binary. So you have to install it first, using
    install.packages("rJava")
  3. Install XLConnect
    Finally, install XLConnect from source:
    install.packages("XLConnect", type="source")

这篇关于在OS 10.8.2上安装R库XLConnect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆