Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- T item V1
- 1 a 2
- 2 a 5
- 1 b 1
- 2 b 2
- T item V1
- 1 a 2
- 2 a 6
- df1 %>%
- left_join(df2, by = c("T", "item")) %>%
- mutate(
- V1 = coalesce(as.numeric(V1.y), as.numeric(V1.x))
- ) %>%
- select(-V1.x, V1.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement