在Ubuntu上找不到R的RODBC包的odbcConnectExcel函数

前端之家收集整理的这篇文章主要介绍了在Ubuntu上找不到R的RODBC包的odbcConnectExcel函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Ubuntu上安装RODBC软件包有点麻烦.首先我学会了安装以下内容
$sudo apt-get install r-cran-rodbc

这还不够好,因为程序包仍然在寻找头文件.我解决了这个问题:

$sudo apt-get install unixodbc-dev

好的,RODBC在Ubuntu机器上正确安装.但是当我尝试运行以下脚本时:

## import excel file from DropBox

require("RODBC")

channel <- odbcConnectExcel("~/DropBox/DATA/SAMPLE/petro.xls")

petro <- sqlFetch (channel,"weekly")

odbcClose(channel)

str(petro)
head(petro)

我收到一个错误抛出函数odbcConnectExcel未找到.我检查了每个字母的情况,确保它不是一个简单的拼写错误.不.然后我在Windows R安装上运行相同的脚本(文件路径当然不同),脚本可以工作.

知道为什么Ubuntu R安装无法找到odbcConnectExcel函数以及如何让它工作?

Excel可用时可以使用该功能.换句话说:不在Ubuntu上.

作为参考,从R Data Import / Export manual(我突出显示):

4.3.2 Package RODBC

Package RODBC on CRAN provides an
interface to database sources
supporting an ODBC interface. This is
very widely available,and allows the
same R code to access different
database systems. RODBC runs on
Unix/Linux,Windows and Mac OS X,and
almost all database systems provide
support for ODBC. We have tested
Microsoft sql Server,Access,MysqL,
Postgresql,Oracle and IBM DB2 on
Windows and MysqL,Oracle,Postgresql
and sqlite on Linux.

ODBC is a client-server system,and we
have happily connected to a DBMS
running on a Unix server from a
Windows client,and vice versa.

On Windows ODBC support is normally
installed,and current versions are
available from
07001 as
part of MDAC. On Unix/Linux you will
need an ODBC Driver Manager such as
unixODBC (07002) or
iOBDC (07003: this is
pre-installed in Mac OS X) and an
installed driver for your database
system.

Windows provides drivers not just for
DBMSs but also for Excel (.xls)
spreadsheets,
DBase (.dbf) files and
even text files. (The named
applications do not need to be
installed. Which file formats are
supported depends on the the versions
of the drivers.) There are versions
for Excel 2007 and Access 2007 (go to
07004,and
search for Office ODBC,which will lead to AccessDatabaseEngine.exe),the `2007 Office System Driver’.

原文链接:https://www.f2er.com/ubuntu/347246.html

猜你在找的Ubuntu相关文章