This assignment aims to assess your understanding of different types of joins in R using the dplyr package. You will work with sample datasets, perform various joins, and answer questions based on the results.
First, ensure you have the dplyr package installed and loaded:
library(dplyr)
Use the following code to create two datasets:
# Dataset 1: Customers
customers <- tibble(
customer_id = c(1, 2, 3, 4, 5),
name = c("Alice", "Bob", "Charlie", "David", "Eve"),
city = c("New York", "Los Angeles", "Chicago", "Houston", "Phoenix")
)
# Dataset 2: Orders
orders <- tibble(
order_id = c(101, 102, 103, 104, 105, 106),
customer_id = c(1, 2, 3, 2, 6, 7),
product = c("Laptop", "Phone", "Tablet", "Desktop", "Camera", "Printer"),
amount = c(1200, 800, 300, 1500, 600, 150)
)
Submit the assignment as a link to RPubs. (3 points)
Total Points: 25
Good luck!