Assignment 2 is now available. Find it here. Submit it on the Google Classroom by 11:59 PM, 3 January 2026

Assignment 2

Exploring Retail Data: A Practical Data Science Project

While purchasing items either online or in-store, customers often share some of their personal information. Your client has collected such data and now seeks insights to answer a few specific questions based on it. Your task is to assist the client by analyzing the dataset and providing meaningful answers. The dataset customer_data.csv required for this task is available here. Answer all the questions by using the tidyverse functions.

1. Load tidyverse and read the csv file.

library(tidyverse)
df <- readr::read_csv('customer_data.csv')

2. View the first 5 rows of the dataset to understand its structure.

3. How many rows and columns are in the dataset?

4. Find the maximum, minimum, and mean age of the customers.

5. What are the three most common customer names?

6. Identify the customers who have the same phone number.?

7. How many customers have the profession “Structural Engineer”?

8. How many male customers are Structural Engineers?

9. Find the female Structural Engineers from the province of Alberta (AB)

10. What is the maximum, minimum, and average spending amount?

11. Who did not spend anything? Company wants to send a deal to encourage the customer to buy stuff!

12. As a loyalty reward, company wants to send thanks coupon to those who spent 100CAD or more, please find out the customers?

13. How many emails are associated with this credit card number ‘5020000000000230’?

14. We need to send new cards to the customers well before the expire, how many cards are expiring in 2019?

15. How many people use Visa as their Credit Card Provider?

16. Can you find the customer who spent 100 CAD using Visa?

17. What are two most common professions?

18. Can you tell the top 5 most popular email providers? (e.g. gmail.com, yahoo.com, etc…)

# use stringr package if needed
# Try learning new things!!

19. Is there any customer who is using email with “am.edu”?

# use stringr::str_detect() to find customers with "am.edu" in their email.

20. Which day of the week, the store gets more customers?

Submission and Deadline

Create a .qmd file, render it to HTML with embed-resources: true. Here is a sample qmd file you can use. Finally submit the rendered html file (not pdf) on the Google Classroom thread by 11:59 PM, 3 January 2026.