Read Tables in a Microsoft Access Database
Assuming the mdbtools
package has been installed on your
system and is in the system path, mdb.get
imports
one or more tables in a Microsoft Access database. Date-time
variables are converted to dates or chron
package date-time
variables. The csv.get
function is used to import
automatically exported csv files. If tables
is unspecified all tables in the database are retrieved. If more than
one table is imported, the result is a list of data frames.
mdb.get(file, tables=NULL, lowernames=FALSE, allow=NULL, dateformat='%m/%d/%y', mdbexportArgs='-b strip', ...)
file |
the file name containing the Access database |
tables |
character vector specifying the names of tables to
import. Default is to import all tables. Specify
|
lowernames |
set this to |
allow |
a vector of characters allowed by R that should not be converted to periods in variable names. By default, underscores in variable names are converted to periods as with R before version 1.9. |
dateformat |
see |
mdbexportArgs |
command line arguments to issue to mdb-export.
Set to |
... |
arguments to pass to |
Uses the mdbtools
package executables mdb-tables
,
mdb-schema
, and mdb-export
(with by default option
-b strip
to drop any binary output). In Debian/Ubuntu Linux run
apt get install mdbtools
.
cleanup.import
is invoked by csv.get
to transform
variables and store them as efficiently as possible.
a new data frame or a list of data frames
Frank Harrell, Vanderbilt University
## Not run: # Read all tables in the Microsoft Access database Nwind.mdb d <- mdb.get('Nwind.mdb') contents(d) for(z in d) print(contents(z)) # Just print the names of tables in the database mdb.get('Nwind.mdb', tables=TRUE) # Import one table Orders <- mdb.get('Nwind.mdb', tables='Orders') ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.