DATA MINING
Desktop Survival Guide by Graham Williams |
|||||
Access |
MS/Access databases, on MSWindows,
can be directly accessed through ODBC with an
odbcConnectAccess. A database can be querired for a list
of all tables available, using sqlTables, and imported
with sqlFetch or sqlQuery. We can then
directly save the table as an R object fo simpler
loading into R at a later time:
> library(RODBC) > channel <- odbcConnectAccess("h:/sample.mdb") > sqlTables(channel)$TABLE_NAME > clients <- sqlFetch(channel, "Clients") > odbcClose(channel) > save(clients, file="clients.RData") |