Database Connections

Learn to pull database data into R in the tidyverse using DBI, odbc, dbplyr, and other database packages.

Most data science tasks begin with pulling data from some external source, sometimes it’s a csv file, but often it’s something else, e.g. live databases, Microsoft Excel sheets, and websites. Those aren’t the only options, but they’re the most common.

Among those options, the most common is to pull from a live database. Live databases have a few significant advantages that support the data science team:

  • Typically, data is up to date. There’s often an automatic pipeline that feeds new data into the database.
  • They can host a vast number of records, depending on the type of database.
  • The database engine can manipulate data without needing to load it into our computer’s memory first.

Get hands-on with 1200+ tech skills courses.