id | name | age |
---|---|---|
1 | Alice | 19 |
2 | Bob | 21 |
4 | Olivia | 20 |
Classwork 9
Joining Two Related Tables in R
Consider the two related data.frames, df_1
and df_2
:
df_1
df_2
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 |
df_1 |> left_join(df_2)
df_2 |> left_join(df_1)
- 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!