DAR CASE STUDY
DAR CASE STUDY
setwd("C:/path_to_your_directory")
Read the CSV File: Use the read.csv() function to load the file into
R.
summary(customer_data)
This provides a summary of the numeric columns (like Age, AnnualIncome,
PurchaseAmount) and shows any missing values.
colSums(is.na(customer_data))
This command will count the number of missing values in each column.
• Please Note $ operator is used to extract elements from list or data frame
by referring to the element’s namr.
• 5. Calculate the Average Purchase Amount:
high_spenders <-
customer_data[customer_data$Purchase.Amount > 200, ]
•
print(high_spenders)
• Create a List for a Specific Customer: