简体   繁体   English

尝试在ubuntu中使用R处理.mdb文件

[英]Trying to work with .mdb files using R in ubuntu

I'm trying to connect with a Microsoft Access database to work with it in R using the odbcConnect function 我正在尝试使用odbcConnect函数连接Microsoft Access数据库以在R中使用它

library(RODBC)
mydb <- odbcConnectAccess("database.mdb")

but when I run the R script it comes with an error 但是当我运行R脚本时会出现错误

Error: could not find function "odbcConnectAccess"
Execution halted

Could the error be related to trying to work with a .mdb file not using Windows? 该错误与尝试不使用Windows的.mdb文件有关吗? And if it is, is there another way to deal with .mdb files in ubuntu using R? 如果是的话,还有其他方法可以使用R处理ubuntu中的.mdb文件吗?

It seems that this is not straight forward. 看来这不是直截了当的。 Ubuntu doesn't have MS Access ODBC drivers by default. 默认情况下,Ubuntu没有MS Access ODBC驱动程序。 This answer may help you . 这个答案可能会帮助您 So the approach via RODBC package may not be fruitful. 因此,通过RODBC包执行的方法可能没有效果。

You could try the R Hmisc package, function mdb.get . 您可以尝试使用R Hmisc软件包的功能mdb.get This worked for me. 这对我有用。 You'll have to install the mdbtools-gmdb (via apt-get), so to have the mdb-tables command in your system. 您必须安装mdbtools-gmdb(通过apt-get),以便在系统中使用mdb-tables命令。

PS: I was also stuck because my original file had a space character within its name, you should avoid that. PS:我也被卡住了,因为我的原始文件名称中有一个空格字符,您应该避免这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM