Given two data frames:
给出两个数据框:
df1 = data.frame(CustomerId = c(1:6), Product = c(rep("Toaster", 3), rep("Radio", 3)))df2 = data.frame(CustomerId = c(2, 4, 6), State = c(rep("Alabama", 2), rep("Ohio", 1)))df1# CustomerId Product# 1 Toaster# 2 Toaster# 3 Toaster# 4 Radio# 5 Radio# 6 Radiodf2# CustomerId State# 2 Alabama# 4 Alabama# 6 Ohiodf1 = data.