Classwork 9

Joining Two Related Tables in R

Author

Byeong-Hak Choe

Published

October 22, 2025

Modified

October 19, 2025


Consider the two related data.frames, df_1 and df_2:

id name age
1 Alice 19
2 Bob 21
4 Olivia 20
id major
1 Economics
2 Business Administration
3 Data Analytics

Which of the following R code correctly join the two related data.frames, df_1 and df_2, to produce the resulting data.frame shown below?

id major name age
1 Economics Alice 19
2 Business Administration Bob 21
3 Data Analytics NA NA
  1. df_1 |> left_join(df_2)
  2. df_2 |> left_join(df_1)
  3. both a and b



Discussion

Welcome to our Classwork 9 Discussion Board! πŸ‘‹

This space is designed for you to engage with your classmates about the material covered in Classwork 9.

Whether you are looking to delve deeper into the content, share insights, or have questions about the content, this is the perfect place for you.

If you have any specific questions for Byeong-Hak (@bcdanl) or peer classmate (@GitHub-Username) regarding the Classwork 9 materials or need clarification on any points, don’t hesitate to ask here.

Let’s collaborate and learn from each other!

Back to top