I am trying to write a function (glue_sth) which performs a left_join but you can specify by which variable to join, like this:
df <- tibble(x = letters[1:10])
df_aux <- tibble(z = letters[1:10], y = 1:10)
glue_sth <- function(df, variable) {
df %>%
left_join(df_aux, by = c(variable = "z"))
}
In this case variable should be x but I can't make it work.