Programmatically read Access (.mdb) files into R for both Windows and Mac

后端 未结 1 1127
半阙折子戏
半阙折子戏 2021-02-14 03:45

I am trying to write an open data package that reads New York State education data into R. That data are provided as an Access database.

I want to write a function that

相关标签:
1条回答
  • 2021-02-14 04:03

    How about just with RODBC? Can you also download and use the mdb file (e.g. to make queries/views directly inside the mdb?)

    I usually load data from Access dbs into R with the following code chunk:

    # read in the data
    library(RODBC)
    db <- odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};
                            DBQ=C:\\Path\\To\\Database\\my_db.accdb")
    
    # Get data
    data <- as_tibble(sqlFetch (db , "Table or Query Name", rownames=TRUE))
    
    0 讨论(0)
提交回复
热议问题