Created
August 15, 2018 14:08
-
-
Save robsalasco/3cb003f5d23d06ce48d1cb9552e8f3e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to open MS Access databases on R | |
# 1. Download UCanAccess https://sourceforge.net/projects/ucanaccess/ | |
# 2. Install RJDBC package in R | |
# Example: | |
library(RJDBC) | |
options(java.parameters = "-Xmx4g") | |
conn <- dbConnect(JDBC("net.ucanaccess.jdbc.UcanloadDriver", | |
"/Downloads/UCanAccess-4.0.4-bin/loader/ucanload.jar"), "jdbc:ucanaccess:///Downloads/base_datos_eodStgo_2012.accdb") | |
dbListTables(conn) | |
dbFetch(dbSendQuery(conn, "SELECT * FROM `Comuna Origen`")) | |
t <- dbSendQuery(conn, "SELECT * FROM Viaje WHERE ComunaOrigen = 71 AND ComunaDestino = 71 LIMIT 10") | |
dbFetch(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment