【问题标题】:Multiple match dataset "Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column"多重匹配数据集\“fix.by(by.x, x) 中的错误:\'by\' 必须指定一个唯一有效的列\”
【发布时间】:2022-11-25 03:38:18
【问题描述】:
Emails <- c("Bob@gmail.com","Mike@aol.com","Lyndsey@blue.com","Ethan@gmail.com","Sara@gmail.com",
           "Sarah@yahoo.com","Leo@stuff.com","Raj@blue.com")
State <- c("Washington","California","Texas","Iowa","New York","California","Alabama","Alaska")
PPP <- data.frame(Emails = Emails,State = State)

Emails <- c("Bob@gmail.com","Mike@aol.com","Lyndsey@blue.com","Ethan@gmail.com","Sara@gmail.com",
           "Sarah@yahoo.com","Leo@stuff.com","Raj@blue.com","Lyndsey@blue.com","Ethan@gmail.com","Sara@gmail.com",
           "Sarah@yahoo.com","Leo@stuff.com","Raj@blue.com","Mike@aol.com","Lyndsey@blue.com","Ethan@gmail.com","Sara@gmail.com",
           "Sarah@yahoo.com","Leo@stuff.com")
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)

fix.by(by.x, x) 中的错误:'by' 必须指定一个唯一有效的列

【问题讨论】:

    标签: r


    【解决方案1】:

    如果您将 y 输入从 ProductPurchased 更改为 Purchases,则合并调用有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-20
      • 2018-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-14
      相关资源
      最近更新 更多