Code
library(DBI) # Unified DB Interface
library(odbc) # Defines ODBC driver
library(dplyr) # Grammar of Data Manipulation
SQL joins are vital to relational database operations, which allow users to combine data from multiple tables based on shared keys. In this example, we will use R as an interface to extract data from Adventure Works
and process a range of joins similar to someone using a SQL GUI.
In R, the dplyr
package provides an intuitive syntax for performing these operations. It always made the most sense for me to extract the data into the platform that I’m creating analytical reports and data visualizations.
Even though I’m technically using Quarto and R, I’m using: