Emails <- c("[email protected]","[email protected]","[email protected]","[email protected]","[email protected]",
"[email protected]","[email protected]","[email protected]")
State <- c("Washington","California","Texas","Iowa","New York","California","Alabama","Alaska")
PPP <- data.frame(Emails = Emails,State = State)
Emails <- c("[email protected]","[email protected]","[email protected]","[email protected]","[email protected]",
"[email protected]","[email protected]","[email protected]","[email protected]","[email protected]","[email protected]",
"[email protected]","[email protected]","[email protected]","[email protected]","[email protected]","[email protected]","[email protected]",
"[email protected]","[email protected]")
ProductPurchased <- c("Hat","Bat","Cat","Hat","Candy","Fruit","Candy","Cat","Hat","Candy","Fruit",
"Candy","Cat","Hat","Candy","Fruit","Candy","Cat","Hat","Candy")
Purchases <- data.frame(Emails = Emails,ProductPurchased = ProductPurchased)
Left <- merge(x = PPP, y = ProductPurchased, by.x = "Emails", by.y = "Emails", all.x = TRUE)
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
CodePudding user response:
The call to merge works if you change the y-input from ProductPurchased to Purchases.