0

I'm trying to connect with a Microsoft Access database to work with it in R using the odbcConnect function

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

but when I run the R script it comes with an error

Error: could not find function "odbcConnectAccess"
Execution halted

Could the error be related to trying to work with a .mdb file not using Windows? And if it is, is there another way to deal with .mdb files in ubuntu using R?

Yagger
  • 111
  • 6

1 Answers1

2

It seems that this is not straight forward. Ubuntu doesn't have MS Access ODBC drivers by default. This answer may help you. So the approach via RODBC package may not be fruitful.

You could try the R Hmisc package, function 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.

PS: I was also stuck because my original file had a space character within its name, you should avoid that.

Community
  • 1
  • 1
Ze Grisi
  • 852
  • 6
  • 4