Closed
Description
As a heavy SQL user, I'm constantly using argument "on" instead of "by" in inner_join and left_join. These functions do echo what they're actually joining on, but it's easy to miss. I feel like these functions should stop you in your tracks if you try to use "on" or throw a warning and make the substitution.
Bit of a contrived example below, but in both cases it's clear the user is intending to join on "id" and not c("id", "x")
library(dplyr)
df <- data.frame(id = c(1,2), x = c(3.4, 2.6))
df2 <- data.frame(id = c(1,2), x = c(3.4, 2.7), z = c(4.4, 5.4))
df %>% inner_join(df2, on="id")
df %>% inner_join(df2, by="id")