How to combine information from different dataset having one column in common?

r
machine_learning
#1

The CUSTOMER dataset contains name and address information for every customer the company has and the unique identifier for the customer is CUSTOMER_NUMBER. The PURCHASES dataset contains information on the purchases made by customers in the last three months and also contains the CUSTOMER_NUMBER variable. Show how you would create a dataset containing all the customers that had not made any purchases in the last three months.

Please someone explain me how to approach this problem with usage of R code?

0 Likes

#2

Use the below code to join your datasets.

library(plyr)

newdf<- join(df2, df1, by = “CUSTOMER_NUMBER” , type=“full”)

Customer having NA value in the columns of PURCHASE dataset will be the customers that had not made any purchases in the last three months.

0 Likes