Getting started

Connect to a Database This article is geared toward those who need to connect to an existing database using an ODBC driver. To review other options, such as using a database R package or JDBC, please refer to the Selecting a database interface page. If the intent is to learn with a local and small database, refer to the example in the dplyr page. Install the DBI and odbc package: install.packages("DBI") install.packages("odbc") Verify that odbc recognizes the installed drivers using odbcListDrivers().
Database Queries With R There are many ways to query data with R. This article shows you three of the most common ways: Using DBI Using dplyr syntax Using R Notebooks Background Several recent package improvements make it easier for you to use databases with R. The query examples below demonstrate some of the capabilities of these R packages. DBI. The DBI specification has gone through many recent improvements. When working with databases, you should always use packages that are DBI-compliant.