closest() now in dev dplyr

This commit is contained in:
Hadley Wickham
2022-09-15 15:57:46 -05:00
parent 8e0e6db1d2
commit 4ac50eb359

View File

@@ -855,17 +855,10 @@ And for each employee we want to find the first party date that comes after (or
We can express that with a rolling join:
```{r}
#| eval: false
employees |>
left_join(parties, join_by(closest(birthday >= party)))
```
```{r}
#| echo: false
employees |>
left_join(parties, join_by(preceding(birthday, party)))
```
### Overlap joins
Overlap joins provide three helpers that use inequality joins to make it easier to work with intervals: