View source: R/access_import.R
access_import | R Documentation |
Directly connect (and disconnect at the end) with the Microssoft Office Access database using the RODBC package and read one or multiple data sets. It can read both tables and SQL queries depending on the input instructions. It automatically detects date variables that are stored also with date format in the original data set.
access_import(file,table_names,ntab=length(table_names),
SQL_query=rep(F,times=ntab),where_sql=c(),out.format="d-m-yy",uid="",pwd="",...)
file |
The path to the file with .mdb extension. |
table_names |
A single character or a character vector containing either the names of the tables to read or the SQL queries to perform. Each position must contain only one table name or SQL querie.The format of the SQL queries must follow the one described in |
where_sql |
If |
out.format |
a character specifying the format for printing the date variables. |
ntab |
The number of tables to import, equal to the number of table names. |
SQL_query |
Auxiliar vector to perform the function. |
uid |
see |
pwd |
see |
... |
see |
By default, the function gives to each data set the name specified in table_names, so the sql queries data set have probably an inappropriate name. It can be easily renamed using names
.
A data frame or a data frame list containing the data requested from the Microsoft Office Access file.
The function don't contribute in the date variables detection, it just process with the Chron package the ones who has been automatically detected.
access_export
,var_view
sqlFetch
, sqlQuery
## Not run:
x<-access_import(file="mydata.mdb",
table_names=c("table1","table2",
"Select * From table1 inner join table2 on table.var1=table2.var2","table3")
,where_sql=c(3))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.