mdb.get {Hmisc} | R Documentation |
Assuming the mdb-tools
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', ...)
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
tables=TRUE to return the list of available tables. |
lowernames |
set this to TRUE to change variable names to
lower case |
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 cleanup.import . Default is the
usual Access format used in the U.S. |
... |
arguments to pass to csv.get |
Uses the mdb-tools
package executables mdb-tables
,
mdb-schema
, and mdb-export
.
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
data.frame
,
cleanup.import
, csv.get
,
Date
, chron
## 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)