Multiple Choices: Joining Data Frames
- Which of the following
dplyr
functions keeps only the rows that have matching values in both tables? ::: {.cell}
- What does
left_join
return when used on two data frames? ::: {.cell}
:::
- Which function includes all rows from both tables, with
NA
values in place where there are no matches? ::: {.cell}
:::
- If
right_join
is applied to two tables, what will the result include? ::: {.cell}
:::
- Which of the following commands can help avoid
NA
values when joining data with only common records between two data frames? ::: {.cell}
:::
- What argument should you use in
dplyr
joins to specify which columns to join by, if the column names differ between two tables? ::: {.cell}
:::
- Which
dplyr
join function would be best suited for combining a table of employees with another table of department names, ensuring that every employee appears, even if they don’t have a department?
- What is the outcome if
full_join
is used on two data frames with no matching keys? ::: {.cell}
:::
- When using
inner_join
, what happens to rows in either data frame that do not have matching keys in the other data frame? ::: {.cell}
:::
- In a
left_join
, which table’s rows are guaranteed to appear in the result regardless of matches in the other table? ::: {.cell}
:::
:::