--- title: Relational Data date: 2018-09-20 subtitle: Joining Relational Data reading: - R4DS [Chapter 13 - Relational Data](http://r4ds.had.co.nz/relational-data.html){target='blank'} tasks: - Join two datasets using a common column - Answer a question that requires understanding how multiple tables are related - Save your script as a .R or .Rmd in your course repository --- ```{r setup, include=FALSE, purl=F} options(knitr.duplicate.label = 'allow') source("functions.R") source("knitr_header.R") ``` # Reading ```{r reading,results='asis',echo=F,purl=F} md_bullet(rmarkdown::metadata$reading) ``` # Background In this exercise you will use various data wrangling tools to answer questions from the data held in separate tables. We'll use the data in the `nycflights13` package which has relationships between the tables as follows.  # Objective > What is the full name (not the three letter code) of the destination airport farthest from any of the NYC airports in the `flights` table? # Tasks ```{r tasks,results='asis',echo=F, purl=F} md_bullet(rmarkdown::metadata$tasks) ``` You will need to load the necessary packages ```{r, message=FALSE} library(tidyverse) library(nycflights13) ``` [ Download starter R script (if desired)](`r output_nocomment`){target="_blank"} There are several ways to do this using at least two different joins. I found two solutions that use 5 or 6 functions separated by pipes (`%>%`). Can you do it in fewer?