Reputation: 323
The ususal syntax of dplyr join functions are
left_join(df1, df2, by = c("Key"))
considering the fact same key exists in both datasets. Is there a way to write pipe operators inside join functions instead of creating another dataset? E.g
df1 %>% mutate(something = some_calc) %>% filter(some filter) left_join(df2 %>% mutate(some filter), by c("key"))
I am getting out of bounds error while joining.
Upvotes: 1
Views: 1584
Reputation: 35187
df1 %>%
mutate(something = some_calc) %>%
filter(some filter) %>%
left_join(df2 %>% mutate(some filter), by = c("key"))
Should work.
Upvotes: 1